1 7 8 package com.sun.corba.se.impl.oa.poa ; 9 10 import java.util.Enumeration ; 11 12 import org.omg.PortableServer.Servant ; 13 import org.omg.PortableServer.ServantManager ; 14 import org.omg.PortableServer.ForwardRequest ; 15 import org.omg.PortableServer.POAPackage.WrongPolicy ; 16 import org.omg.PortableServer.POAPackage.ObjectNotActive ; 17 import org.omg.PortableServer.POAPackage.ServantNotActive ; 18 import org.omg.PortableServer.POAPackage.ObjectAlreadyActive ; 19 import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; 20 import org.omg.PortableServer.POAPackage.NoServant ; 21 22 import com.sun.corba.se.impl.orbutil.concurrent.SyncUtil ; 23 import com.sun.corba.se.impl.orbutil.ORBUtility ; 24 import com.sun.corba.se.impl.orbutil.ORBConstants ; 25 26 29 public class POAPolicyMediatorImpl_NR_UDS extends POAPolicyMediatorBase { 30 private Servant defaultServant ; 31 32 POAPolicyMediatorImpl_NR_UDS( Policies policies, POAImpl poa ) 33 { 34 super( policies, poa ) ; 35 36 if (policies.retainServants()) 38 throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; 39 40 if (!policies.useDefaultServant()) 41 throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ; 42 43 defaultServant = null ; 44 } 45 46 protected java.lang.Object internalGetServant( byte[] id, 47 String operation ) throws ForwardRequest 48 { 49 if (defaultServant == null) 50 throw poa.invocationWrapper().poaNoDefaultServant() ; 51 52 return defaultServant; 53 } 54 55 public void returnServant() 56 { 57 } 59 60 public void etherealizeAll() 61 { 62 } 64 65 public void clearAOM() 66 { 67 } 69 70 public ServantManager getServantManager() throws WrongPolicy 71 { 72 throw new WrongPolicy (); 73 } 74 75 public void setServantManager( ServantManager servantManager ) throws WrongPolicy 76 { 77 throw new WrongPolicy (); 78 } 79 80 public Servant getDefaultServant() throws NoServant , WrongPolicy 81 { 82 if (defaultServant == null) 83 throw new NoServant (); 84 return defaultServant; 85 } 86 87 public void setDefaultServant( Servant servant ) throws WrongPolicy 88 { 89 this.defaultServant = servant; 90 setDelegate(defaultServant, "DefaultServant".getBytes()); 91 } 92 93 public final void activateObject(byte[] id, Servant servant) 94 throws WrongPolicy , ServantAlreadyActive , ObjectAlreadyActive 95 { 96 throw new WrongPolicy (); 97 } 98 99 public Servant deactivateObject( byte[] id ) throws ObjectNotActive , WrongPolicy 100 { 101 throw new WrongPolicy (); 102 } 103 104 public byte[] servantToId( Servant servant ) throws ServantNotActive , WrongPolicy 105 { 106 throw new WrongPolicy (); 107 } 108 109 public Servant idToServant( byte[] id ) 110 throws WrongPolicy , ObjectNotActive 111 { 112 if (defaultServant != null) 113 return defaultServant; 114 115 throw new ObjectNotActive () ; 116 } 117 } 118 | Popular Tags |