1 package demo.poa_monitor.user_poa; 2 3 import demo.poa_monitor.foox.*; 4 import org.omg.PortableServer.*; 5 import org.omg.PortableServer.ServantLocatorPackage.CookieHolder ; 6 7 public class FooServantLocatorImpl 8 extends org.omg.PortableServer._ServantLocatorLocalBase 9 { 10 private FooImpl foo = new FooImpl("0"); 11 12 public void postinvoke(byte[] oid, 13 POA adapter, 14 String operation, 15 java.lang.Object cookie, 16 Servant servant) 17 { 18 String oidStr = new String (oid); 19 if (!oidStr.equals(cookie)) 20 { 21 System.out.println("[ postinvoke "+operation+" for oid: "+oidStr+": cookie is unknown ]"); 22 throw new org.omg.CORBA.OBJECT_NOT_EXIST (); 23 } 24 } 25 26 public Servant preinvoke(byte[] oid, 27 POA adapter, 28 String operation, CookieHolder cookie) 29 throws ForwardRequest 30 { 31 String oidStr = new String (oid); 32 int oidInt = Integer.parseInt(oidStr); 33 if (oidInt >= 1000) 34 { 35 cookie.value = oidStr; 36 return foo; 37 } 38 return null; 39 } 40 } 41 | Popular Tags |