Home » Developer & Programmer » Precompilers, OCI & OCCI » (ERROR) FAN - Fast Application Notification (Oracle 11g r2)
(ERROR) FAN - Fast Application Notification [message #573057] Thu, 20 December 2012 07:00 Go to next message
timoteolange
Messages: 4
Registered: December 2012
Location: Brasil
Junior Member

Dear,

I am implementing the fan (Fast Application Notification) feature available in Oracle RAC and am following the Oracle documentation (http: // docs.oracle.com / cd/E11882_01 / java.112 / e16548 / apxracfan.htm) but the Java client does not work (not receiving notifications).

Does anyone have an example (the program) ready and can share?

Thank you in advance for help,

TL
Re: (ERROR) FAN - Fast Application Notification [message #573061 is a reply to message #573057] Thu, 20 December 2012 07:12 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post your code.

Regards
Michel
Re: (ERROR) FAN - Fast Application Notification [message #573063 is a reply to message #573061] Thu, 20 December 2012 07:16 Go to previous message
timoteolange
Messages: 4
Registered: December 2012
Location: Brasil
Junior Member

import java.util.Properties;
import oracle.simplefan.FanEventListener;
import oracle.simplefan.FanManager;
import oracle.simplefan.FanSubscription;
import oracle.simplefan.LoadAdvisoryEvent;
import oracle.simplefan.NodeDownEvent;
import oracle.simplefan.ServiceDownEvent;

public class Run {

Run() {
Properties p = new Properties();
p.put("oracle_service", "grid_fan_test");
System.setProperty("oracle.ons.oraclehome","/oracle/app/oracle/dbhome");

FanSubscription sub = FanManager.getInstance().subscribe(p);

System.out.println("I'm subscribed!");
sub.addListener(new FanEventListener() {

public void handleEvent(ServiceDownEvent arg0) {
System.out.println("Service Down registered!");
}

public void handleEvent(NodeDownEvent arg0) {
System.out.println("Node Down Event Registered");
}

public void handleEvent(LoadAdvisoryEvent arg0) {
System.out.println("Just got a Load Advisory event");
System.out.println("originating instance: " + arg0.getInstanceName());
System.out.println("Service Quality: " + arg0.getServiceQuality());
System.out.println("Percent: " + arg0.getPercent());
System.out.println("Service Name: " + arg0.getServiceName());
System.out.println("Observed at: " + arg0.getTimestamp() + "\n\n");
}
});
}

public static void main(String[] args) {
Run tc = new Run();
int i = 0;
while (i<100) {
try {
Thread.sleep(100);
i++;
} catch (Exception e) {
System.out.println(e);
}
}
System.out.println("execution ended");
}
}
Previous Topic: Pro C files not converting from .pc to .c
Next Topic: Pro*C file compilation error
Goto Forum:
  


Current Time: Sun Oct 26 03:06:30 CDT 2014

Total time taken to generate the page: 0.16619 seconds