Methods Summary |
---|
public void | checkShutdownState()
if (status == STATUS_DESTROYED) {
throw wrapper.orbDestroyed() ;
}
if (status == STATUS_SHUTDOWN) {
throw omgWrapper.badOperationAfterShutdown() ;
}
|
public synchronized void | connect(org.omg.CORBA.Object servant)This is the implementation of the public API used to connect
a servant-skeleton to the ORB.
checkShutdownState();
if (getTOAFactory() == null)
throw wrapper.noToa() ;
try {
String codebase = javax.rmi.CORBA.Util.getCodebase( servant.getClass() ) ;
getTOAFactory().getTOA( codebase ).connect( servant ) ;
} catch ( Exception ex ) {
throw wrapper.orbConnectError( ex ) ;
}
|
public com.sun.corba.se.pept.protocol.ClientInvocationInfo | createOrIncrementInvocationInfo()
StackImpl invocationInfoStack =
(StackImpl) clientInvocationInfoStack.get();
ClientInvocationInfo clientInvocationInfo = null;
if (!invocationInfoStack.empty()) {
clientInvocationInfo =
(ClientInvocationInfo) invocationInfoStack.peek();
}
if ((clientInvocationInfo == null) ||
(!clientInvocationInfo.isRetryInvocation()))
{
// This is a new call - not a retry.
clientInvocationInfo = new CorbaInvocationInfo(this);
invocationInfoStack.push(clientInvocationInfo);
}
// Reset retry so recursive calls will get a new info object.
clientInvocationInfo.setIsRetryInvocation(false);
clientInvocationInfo.incrementEntryCount();
return clientInvocationInfo;
|
public synchronized org.omg.CORBA.TypeCode | create_abstract_interface_tc(java.lang.String id, java.lang.String name)
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name);
|
public synchronized org.omg.CORBA.TypeCode | create_alias_tc(java.lang.String id, java.lang.String name, org.omg.CORBA.TypeCode original_type)Create a TypeCode for an alias.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type);
|
public synchronized org.omg.CORBA.Any | create_any()Create a new Any
checkShutdownState();
return new AnyImpl(this);
|
public synchronized org.omg.CORBA.TypeCode | create_array_tc(int length, org.omg.CORBA.TypeCode element_type)Create a TypeCode for an array.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_array, length, element_type);
|
public synchronized org.omg.CORBA.ContextList | create_context_list()Create a ContextList
checkShutdownState();
return new ContextListImpl(this);
|
public synchronized org.omg.CORBA.TypeCode | create_enum_tc(java.lang.String id, java.lang.String name, java.lang.String[] members)Create a TypeCode for an enum.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members);
|
public synchronized org.omg.CORBA.Environment | create_environment()Create an Environment
checkShutdownState();
return new EnvironmentImpl();
|
public synchronized org.omg.CORBA.ExceptionList | create_exception_list()Create an ExceptionList
checkShutdownState();
return new ExceptionListImpl();
|
public synchronized org.omg.CORBA.TypeCode | create_exception_tc(java.lang.String id, java.lang.String name, org.omg.CORBA.StructMember[] members)Create a TypeCode for an exception.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_except, id, name, members);
|
public synchronized org.omg.CORBA.TypeCode | create_fixed_tc(short digits, short scale)
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
|
public synchronized org.omg.CORBA.TypeCode | create_interface_tc(java.lang.String id, java.lang.String name)Create a TypeCode for an interface.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_objref, id, name);
|
public synchronized org.omg.CORBA.NVList | create_list(int count)Create an NVList
checkShutdownState();
return new NVListImpl(this, count);
|
public synchronized org.omg.CORBA.NamedValue | create_named_value(java.lang.String s, org.omg.CORBA.Any any, int flags)Create a NamedValue
checkShutdownState();
return new NamedValueImpl(this, s, any, flags);
|
public synchronized org.omg.CORBA.TypeCode | create_native_tc(java.lang.String id, java.lang.String name)
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_native, id, name);
|
public synchronized org.omg.CORBA.NVList | create_operation_list(org.omg.CORBA.Object oper)Create an NVList corresponding to an OperationDef
checkShutdownState();
throw wrapper.genericNoImpl() ;
|
public synchronized org.omg.CORBA.portable.OutputStream | create_output_stream()The following methods are standard public CORBA ORB APIs
checkShutdownState();
return new EncapsOutputStream(this);
|
public synchronized org.omg.CORBA.Policy | create_policy(int type, org.omg.CORBA.Any val)
checkShutdownState() ;
return pihandler.create_policy( type, val ) ;
|
public synchronized org.omg.CORBA.TypeCode | create_recursive_sequence_tc(int bound, int offset)Create a recursive TypeCode in a sequence.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset);
|
public synchronized org.omg.CORBA.TypeCode | create_recursive_tc(java.lang.String id)
checkShutdownState();
return new TypeCodeImpl(this, id);
|
public synchronized org.omg.CORBA.TypeCode | create_sequence_tc(int bound, org.omg.CORBA.TypeCode element_type)Create a TypeCode for a sequence.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
|
public synchronized org.omg.CORBA.TypeCode | create_string_tc(int bound)Create a TypeCode for a string.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_string, bound);
|
public synchronized org.omg.CORBA.TypeCode | create_struct_tc(java.lang.String id, java.lang.String name, org.omg.CORBA.StructMember[] members)Create a TypeCode for a structure.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_struct, id, name, members);
|
public synchronized org.omg.CORBA.TypeCode | create_union_tc(java.lang.String id, java.lang.String name, org.omg.CORBA.TypeCode discriminator_type, org.omg.CORBA.UnionMember[] members)Create a TypeCode for a union.
checkShutdownState();
return new TypeCodeImpl(this,
TCKind._tk_union,
id,
name,
discriminator_type,
members);
|
public synchronized org.omg.CORBA.TypeCode | create_value_box_tc(java.lang.String id, java.lang.String name, org.omg.CORBA.TypeCode boxed_type)
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_value_box, id, name,
boxed_type);
|
public synchronized org.omg.CORBA.TypeCode | create_value_tc(java.lang.String id, java.lang.String name, short type_modifier, org.omg.CORBA.TypeCode concrete_base, org.omg.CORBA.ValueMember[] members)
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_value, id, name,
type_modifier, concrete_base, members);
|
public synchronized org.omg.CORBA.TypeCode | create_wstring_tc(int bound)Create a TypeCode for a wide string.
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_wstring, bound);
|
public synchronized void | destroy()formal/99-10-07 p 159: "If destroy is called on an ORB that has
not been shut down, it will start the shutdown process and block until
the ORB has shut down before it destroys the ORB."
if (status == STATUS_OPERATING) {
shutdown(true);
}
getCorbaTransportManager().close();
getPIHandler().destroyInterceptors() ;
status = STATUS_DESTROYED;
|
public synchronized void | disconnect(org.omg.CORBA.Object obj)
checkShutdownState();
if (getTOAFactory() == null)
throw wrapper.noToa() ;
try {
getTOAFactory().getTOA().disconnect( obj ) ;
} catch ( Exception ex ) {
throw wrapper.orbConnectError( ex ) ;
}
|
private void | dprint(java.lang.String msg)
ORBUtility.dprint( this, msg ) ;
|
public void | finishedDispatch()
synchronized (invocationObj) {
numInvocations--;
isProcessingInvocation.set(Boolean.FALSE);
if (numInvocations == 0) {
synchronized (waitForCompletionObj) {
waitForCompletionObj.notifyAll();
}
} else if (numInvocations < 0) {
throw wrapper.numInvocationsAlreadyZero(
CompletionStatus.COMPLETED_YES ) ;
}
}
|
public com.sun.corba.se.spi.protocol.ClientDelegateFactory | getClientDelegateFactory()
synchronized (clientDelegateFactoryAccessorLock) {
return clientDelegateFactory ;
}
|
public com.sun.corba.se.spi.copyobject.CopierManager | getCopierManager()
return copierManager ;
|
public synchronized com.sun.corba.se.spi.transport.CorbaContactInfoListFactory | getCorbaContactInfoListFactory()
return corbaContactInfoListFactory ;
|
public com.sun.corba.se.spi.transport.CorbaTransportManager | getCorbaTransportManager()
return (CorbaTransportManager) getTransportManager();
|
public synchronized com.sun.corba.se.spi.ior.IOR | getFVDCodeBaseIOR()
if (codeBaseIOR != null) // i.e. We are already connected to it
return codeBaseIOR;
// backward compatability 4365188
CodeBase cb;
ValueHandler vh = ORBUtility.createValueHandler(this);
cb = (CodeBase)vh.getRunTimeCodeBase();
return ORBUtility.connectAndGetIOR( this, cb ) ;
|
private java.lang.String | getHostName(java.lang.String host)The following public methods are for ORB shutdown.
return InetAddress.getByName( host ).getHostAddress();
|
public com.sun.corba.se.pept.protocol.ClientInvocationInfo | getInvocationInfo()
StackImpl invocationInfoStack =
(StackImpl) clientInvocationInfoStack.get();
return (ClientInvocationInfo) invocationInfoStack.peek();
|
public com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager | getLegacyServerSocketManager()
synchronized (legacyServerSocketManagerAccessLock) {
if (legacyServerSocketManager == null) {
legacyServerSocketManager = new LegacyServerSocketManagerImpl(this);
}
return legacyServerSocketManager;
}
|
private synchronized java.lang.String | getLocalHostName()
if (localHostString == null) {
try {
localHostString = InetAddress.getLocalHost().getHostAddress();
} catch (Exception ex) {
throw wrapper.getLocalHostFailed( ex ) ;
}
}
return localHostString ;
|
public com.sun.corba.se.spi.resolver.LocalResolver | getLocalResolver()Get the LocalResolver used in this ORB. This LocalResolver is used for
register_initial_reference only.
synchronized (resolverLock) {
return localResolver ;
}
|
public com.sun.corba.se.spi.orb.ORBData | getORBData()
return configData ;
|
public com.sun.corba.se.spi.orb.ORBVersion | getORBVersion()
return (ORBVersion)(orbVersionThreadLocal.get()) ;
|
public com.sun.corba.se.spi.ior.ObjectKeyFactory | getObjectKeyFactory()
synchronized (objectKeyFactoryAccessLock) {
return objectKeyFactory ;
}
|
public com.sun.corba.se.spi.protocol.PIHandler | getPIHandler()
return pihandler ;
|
private synchronized com.sun.corba.se.impl.oa.poa.POAFactory | getPOAFactory()
if (poaFactory == null) {
poaFactory = (POAFactory)requestDispatcherRegistry.getObjectAdapterFactory(
ORBConstants.TRANSIENT_SCID ) ;
}
return poaFactory ;
|
public com.sun.corba.se.spi.protocol.RequestDispatcherRegistry | getRequestDispatcherRegistry()
return requestDispatcherRegistry;
|
public com.sun.corba.se.spi.resolver.Resolver | getResolver()Get the resolver used in this ORB. This resolver will be used for list_initial_services
and resolve_initial_references.
synchronized (resolverLock) {
return resolver ;
}
|
public com.sun.corba.se.spi.servicecontext.ServiceContextRegistry | getServiceContextRegistry()
return serviceContextRegistry ;
|
private synchronized com.sun.corba.se.impl.oa.toa.TOAFactory | getTOAFactory()
if (toaFactory == null) {
toaFactory = (TOAFactory)requestDispatcherRegistry.getObjectAdapterFactory(
ORBConstants.TOA_SCID ) ;
}
return toaFactory ;
|
public com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder | getTaggedComponentFactoryFinder()
return taggedComponentFactoryFinder ;
|
public com.sun.corba.se.spi.ior.IdentifiableFactoryFinder | getTaggedProfileFactoryFinder()
return taggedProfileFactoryFinder ;
|
public com.sun.corba.se.spi.ior.IdentifiableFactoryFinder | getTaggedProfileTemplateFactoryFinder()
return taggedProfileTemplateFactoryFinder ;
|
public com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager | getThreadPoolManager()
synchronized (threadPoolManagerAccessLock) {
if (threadpoolMgr == null) {
threadpoolMgr = new ThreadPoolManagerImpl( threadGroup );
}
return threadpoolMgr;
}
|
public int | getTransientServerId()
if( configData.getORBServerIdPropertySpecified( ) ) {
// ORBServerId is specified then use that value
return configData.getPersistentServerId( );
}
return transientServerId;
|
public com.sun.corba.se.pept.transport.TransportManager | getTransportManager()
synchronized (transportManagerAccessorLock) {
if (transportManager == null) {
transportManager = new CorbaTransportManagerImpl(this);
}
return transportManager;
}
|
public synchronized com.sun.corba.se.impl.corba.TypeCodeImpl | getTypeCodeForClass(java.lang.Class c)
if (typeCodeForClassMap == null)
return null;
return (TypeCodeImpl)typeCodeForClassMap.get(c);
|
public com.sun.corba.se.spi.orb.Operation | getURLOperation()Get the operation used in string_to_object calls. The Operation must expect a
String and return an org.omg.CORBA.Object.
synchronized (resolverLock) {
return urlOperation ;
}
|
public synchronized org.omg.CORBA.Current | get_current()Get a Current pseudo-object.
The Current interface is used to manage thread-specific
information for use by the transactions, security and other
services. This method is deprecated,
and replaced by ORB.resolve_initial_references("NameOfCurrentObject");
checkShutdownState();
/* _REVISIT_
The implementation of get_current is not clear. How would
ORB know whether the caller wants a Current for transactions
or security ?? Or is it assumed that there is just one
implementation for both ? If Current is thread-specific,
then it should not be instantiated; so where does the
ORB get a Current ?
This should probably be deprecated. */
throw wrapper.genericNoImpl() ;
|
public synchronized org.omg.CORBA.Context | get_default_context()Get the default Context object
checkShutdownState();
throw wrapper.genericNoImpl() ;
|
public org.omg.CORBA.Request | get_next_response()Get the next request that has gotten a response.
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
|
public synchronized org.omg.CORBA.TypeCode | get_primitive_tc(org.omg.CORBA.TCKind tcKind)Get the TypeCode for a primitive type.
checkShutdownState();
return get_primitive_tc( tcKind.value() ) ;
|
public void | handleBadServerId(com.sun.corba.se.spi.ior.ObjectKey okey)
synchronized (badServerIdHandlerAccessLock) {
if (badServerIdHandler == null)
throw wrapper.badServerId() ;
else
badServerIdHandler.handle( okey ) ;
}
|
public void | initBadServerIdHandler()
synchronized (badServerIdHandlerAccessLock) {
Class cls = configData.getBadServerIdHandler() ;
if (cls != null) {
try {
Class[] params = new Class[] { org.omg.CORBA.ORB.class };
java.lang.Object[] args = new java.lang.Object[]{this};
Constructor cons = cls.getConstructor(params);
badServerIdHandler =
(BadServerIdHandler) cons.newInstance(args);
} catch (Exception e) {
throw wrapper.errorInitBadserveridhandler( e ) ;
}
}
}
|
public boolean | isDuringDispatch()
Boolean value = (Boolean)(isProcessingInvocation.get()) ;
return value.booleanValue() ;
|
public boolean | isLocalHost(java.lang.String hostName)
return hostName.equals( configData.getORBServerHost() ) ||
hostName.equals( getLocalHostName() ) ;
|
public boolean | isLocalServerId(int subcontractId, int serverId)
if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
(subcontractId > ORBConstants.MAX_POA_SCID))
return serverId == getTransientServerId( ) ;
// XXX isTransient info should be stored in subcontract registry
if (ORBConstants.isTransient( subcontractId ))
return (serverId == getTransientServerId()) ;
else if (configData.getPersistentServerIdInitialized())
return (serverId == configData.getPersistentServerId()) ;
else
return false ;
|
public java.lang.String[] | list_initial_services()Get a list of the initially available CORBA services.
This does not work unless an ORBInitialHost is specified during
initialization (or unless there is an ORB running on the AppletHost)
since the localhostname
is inaccessible to applets. If a service properties URL was specified,
then it is used, otherwise the bootstrapping protocol is used.
Resolver res ;
synchronized( this ) {
checkShutdownState();
res = resolver ;
}
synchronized (resolverLock) {
java.util.Set keys = res.list() ;
return (String[])keys.toArray( new String[keys.size()] ) ;
}
|
public synchronized org.omg.CORBA.portable.ValueFactory | lookup_value_factory(java.lang.String repositoryID)Finds and returns a value factory for the given repository ID.
The value factory returned was previously registered by a call to
{@link #register_value_factory} or is the default factory.
checkShutdownState();
ValueFactory factory =
(ValueFactory)valueFactoryCache.get(repositoryID);
if (factory == null) {
try {
factory = Utility.getFactory(null, null, null, repositoryID);
} catch(org.omg.CORBA.MARSHAL ex) {
throw wrapper.unableFindValueFactory( ex ) ;
}
}
return factory ;
|
public void | notifyORB()Notify response to ORB for get_next_response
synchronized (this.svResponseReceived) {
this.svResponseReceived.set();
this.svResponseReceived.notify();
}
|
public synchronized java.lang.String | object_to_string(org.omg.CORBA.Object obj)Convert an object ref to a string.
checkShutdownState();
// Handle the null objref case
if (obj == null) {
IOR nullIOR = IORFactories.makeIOR( this ) ;
return nullIOR.stringify();
}
IOR ior = null ;
try {
ior = ORBUtility.connectAndGetIOR( this, obj ) ;
} catch (BAD_PARAM bp) {
// Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
throw omgWrapper.notAnObjectImpl( bp ) ;
} else
// Not a local object problem: just rethrow the exception.
// Do not wrap and log this, since it was already logged at its
// point of origin.
throw bp ;
}
return ior.stringify() ;
|
public com.sun.corba.se.spi.oa.OAInvocationInfo | peekInvocationInfo()
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
return (OAInvocationInfo)(stack.peek()) ;
|
public synchronized void | perform_work()This method does nothing. It is not required by the spec to do anything!
checkShutdownState();
throw wrapper.genericNoImpl() ;
|
public synchronized boolean | poll_next_response()Find out if any of the deferred invocations have a response yet.
checkShutdownState();
Request currRequest;
// poll on each pending request
Enumeration ve = dynamicRequests.elements();
while (ve.hasMoreElements() == true) {
currRequest = (Request)ve.nextElement();
if (currRequest.poll_response() == true) {
return true;
}
}
return false;
|
public com.sun.corba.se.spi.oa.OAInvocationInfo | popInvocationInfo()
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
return (OAInvocationInfo)(stack.pop()) ;
|
private void | postInit(java.lang.String[] params, com.sun.corba.se.spi.orb.DataCollector dataCollector)
// First, create the standard ORB config data.
// This must be initialized before the ORBConfigurator
// is executed.
configData = new ORBDataParserImpl( this, dataCollector) ;
// Set the debug flags early so they can be used by other
// parts of the initialization.
setDebugFlags( configData.getORBDebugFlags() ) ;
// REVISIT: this should go away after more transport init cleanup
// and going to ORT based ORBD.
getTransportManager();
getLegacyServerSocketManager();
// Create a parser to get the configured ORBConfigurator.
ConfigParser parser = new ConfigParser() ;
parser.init( dataCollector ) ;
ORBConfigurator configurator = null ;
try {
configurator =
(ORBConfigurator)(parser.configurator.newInstance()) ;
} catch (Exception iexc) {
throw wrapper.badOrbConfigurator( iexc, parser.configurator.getName() ) ;
}
// Finally, run the configurator. Note that the default implementation allows
// other configurators with their own parsers to run,
// using the same DataCollector.
try {
configurator.configure( dataCollector, this ) ;
} catch (Exception exc) {
throw wrapper.orbConfiguratorError( exc ) ;
}
// Last of all, create the PIHandler and run the ORB initializers.
pihandler = new PIHandlerImpl( this, params) ;
pihandler.initialize() ;
// Initialize the thread manager pool and byte buffer pool
// so they may be initialized & accessed without synchronization
getThreadPoolManager();
super.getByteBufferPool();
|
private void | preInit(java.lang.String[] params, java.util.Properties props)The following methods are ORB initialization
// Before ORBConfiguration we need to set a PINoOpHandlerImpl,
// because PersisentServer Initialization inside configurator will
// invoke orb.resolve_initial_references( ) which will result in a
// check on piHandler to invoke Interceptors. We do not want any
// Interceptors to be invoked before the complete ORB initialization.
// piHandler will be replaced by a real PIHandler implementation at the
// end of this method.
pihandler = new PINoOpHandlerImpl( );
// See bugs 4916766 and 4936203
// We intend to create new threads in a reliable thread group.
// This avoids problems if the application/applet
// creates a thread group, makes JavaIDL calls which create a new
// connection and ReaderThread, and then destroys the thread
// group. If our ReaderThreads were to be part of such destroyed thread
// group then it might get killed and cause other invoking threads
// sharing the same connection to get a non-restartable
// CommunicationFailure. We'd like to avoid that.
//
// Our solution is to create all of our threads in the highest thread
// group that we have access to, given our own security clearance.
//
try {
// try to get a thread group that's as high in the threadgroup
// parent-child hierarchy, as we can get to.
// this will prevent an ORB thread created during applet-init from
// being killed when an applet dies.
threadGroup = (ThreadGroup) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
ThreadGroup tg = Thread.currentThread().getThreadGroup() ;
ThreadGroup ptg = tg ;
try {
while (ptg != null) {
tg = ptg;
ptg = tg.getParent();
}
} catch (SecurityException se) {
// Discontinue going higher on a security exception.
}
return new ThreadGroup(tg, "ORB ThreadGroup");
}
}
);
} catch (SecurityException e) {
// something wrong, we go back to the original code
threadGroup = Thread.currentThread().getThreadGroup();
}
// This is the unique id of this server (JVM). Multiple incarnations
// of this server will get different ids.
// Compute transientServerId = milliseconds since Jan 1, 1970
// Note: transientServerId will wrap in about 2^32 / 86400000 = 49.7 days.
// If two ORBS are started at the same time then there is a possibility
// of having the same transientServerId. This may result in collision
// and may be a problem in ior.isLocal() check to see if the object
// belongs to the current ORB. This problem is taken care of by checking
// to see if the IOR port matches ORB server port in legacyIsLocalServerPort()
// method.
//
// XXX need to move server ID to a string for CORBA 3.0. At that point,
// make this more unique (possibly use java.rmi.server.UID).
transientServerId = (int)System.currentTimeMillis();
orbVersionThreadLocal = new ThreadLocal () {
protected java.lang.Object initialValue() {
// set default to version of the ORB with correct Rep-ids
return ORBVersionFactory.getORBVersion() ;
}
};
resolverLock = new java.lang.Object() ;
requestDispatcherRegistry = new RequestDispatcherRegistryImpl(
this, ORBConstants.DEFAULT_SCID);
copierManager = new CopierManagerImpl( this ) ;
taggedComponentFactoryFinder =
new TaggedComponentFactoryFinderImpl(this) ;
taggedProfileFactoryFinder =
new TaggedProfileFactoryFinderImpl(this) ;
taggedProfileTemplateFactoryFinder =
new TaggedProfileTemplateFactoryFinderImpl(this) ;
dynamicRequests = new Vector();
svResponseReceived = new SynchVariable();
OAInvocationInfoStack =
new ThreadLocal () {
protected java.lang.Object initialValue()
{
return new StackImpl();
}
};
clientInvocationInfoStack =
new ThreadLocal() {
protected java.lang.Object initialValue() {
return new StackImpl();
}
};
serviceContextRegistry = new ServiceContextRegistry( this ) ;
|
public void | pushInvocationInfo(com.sun.corba.se.spi.oa.OAInvocationInfo info)
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
stack.push( info ) ;
|
public void | register_initial_reference(java.lang.String id, org.omg.CORBA.Object obj)If this operation is called with an id, "Y" , and an
object, YY , then a subsequent call to
ORB.resolve_initial_references( "Y" ) will
return object YY .
CorbaServerRequestDispatcher insnd ;
if ((id == null) || (id.length() == 0))
throw new InvalidName() ;
synchronized (this) {
checkShutdownState();
}
synchronized (resolverLock) {
insnd = insNamingDelegate ;
java.lang.Object obj2 = localResolver.resolve( id ) ;
if (obj2 != null)
throw new InvalidName(id + " already registered") ;
localResolver.register( id, ClosureFactory.makeConstant( obj )) ;
}
synchronized (this) {
if (StubAdapter.isStub(obj))
// Make all remote object references available for INS.
requestDispatcherRegistry.registerServerRequestDispatcher(
insnd, id ) ;
}
|
public synchronized org.omg.CORBA.portable.ValueFactory | register_value_factory(java.lang.String repositoryID, org.omg.CORBA.portable.ValueFactory factory)Registers a value factory for a particular repository ID.
checkShutdownState();
if ((repositoryID == null) || (factory == null))
throw omgWrapper.unableRegisterValueFactory() ;
return (ValueFactory)valueFactoryCache.put(repositoryID, factory);
|
public void | releaseOrDecrementInvocationInfo()
StackImpl invocationInfoStack =
(StackImpl)clientInvocationInfoStack.get();
ClientInvocationInfo clientInvocationInfo = null;
if (!invocationInfoStack.empty()) {
clientInvocationInfo =
(ClientInvocationInfo)invocationInfoStack.peek();
} else {
throw wrapper.invocationInfoStackEmpty() ;
}
clientInvocationInfo.decrementEntryCount();
if (clientInvocationInfo.getEntryCount() == 0) {
invocationInfoStack.pop();
}
|
public org.omg.CORBA.Object | resolve_initial_references(java.lang.String identifier)Resolve the stringified reference of one of the initially
available CORBA services.
Resolver res ;
synchronized( this ) {
checkShutdownState();
res = resolver ;
}
synchronized (resolverLock) {
org.omg.CORBA.Object result = res.resolve( identifier ) ;
if (result == null)
throw new InvalidName() ;
else
return result ;
}
|
public void | run()The following methods (introduced in POA / CORBA2.1) deal with
shutdown / single threading.
synchronized (this) {
checkShutdownState();
}
synchronized (runObj) {
try {
runObj.wait();
} catch ( InterruptedException ex ) {}
}
|
public synchronized void | send_multiple_requests_deferred(org.omg.CORBA.Request[] req)Send multiple dynamic requests asynchronously.
checkShutdownState();
// add the new Requests to pending dynamic Requests
for (int i = 0; i < req.length; i++) {
dynamicRequests.addElement(req[i]);
}
// Invoke the send_deferred on each new Request
for (int i = 0; i < req.length; i++) {
AsynchInvoke invokeObject = new AsynchInvoke( this,
(com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
new Thread(invokeObject).start();
}
|
public synchronized void | send_multiple_requests_oneway(org.omg.CORBA.Request[] req)
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
|
public void | setBadServerIdHandler(com.sun.corba.se.impl.oa.poa.BadServerIdHandler handler)
synchronized (badServerIdHandlerAccessLock) {
badServerIdHandler = handler;
}
|
public void | setClientDelegateFactory(com.sun.corba.se.spi.protocol.ClientDelegateFactory factory)
synchronized (clientDelegateFactoryAccessorLock) {
clientDelegateFactory = factory ;
}
|
public void | setCorbaContactInfoListFactory(com.sun.corba.se.spi.transport.CorbaContactInfoListFactory factory)
synchronized (corbaContactInfoListFactoryAccessLock) {
corbaContactInfoListFactory = factory ;
}
|
protected void | setDebugFlags(java.lang.String[] args)
for (int ctr=0; ctr<args.length; ctr++ ) {
String token = args[ctr] ;
// If there is a public boolean data member in this class
// named token + "DebugFlag", set it to true.
try {
Field fld = this.getClass().getField( token + "DebugFlag" ) ;
int mod = fld.getModifiers() ;
if (Modifier.isPublic( mod ) && !Modifier.isStatic( mod ))
if (fld.getType() == boolean.class)
fld.setBoolean( this, true ) ;
} catch (Exception exc) {
// ignore it XXX log this as info
}
}
|
public void | setINSDelegate(com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher sdel)
synchronized (resolverLock) {
insNamingDelegate = sdel ;
}
|
public void | setLocalResolver(com.sun.corba.se.spi.resolver.LocalResolver resolver)Set the LocalResolver used in this ORB. This LocalResolver is used for
register_initial_reference only.
synchronized (resolverLock) {
this.localResolver = resolver ;
}
|
public void | setORBVersion(com.sun.corba.se.spi.orb.ORBVersion verObj)
orbVersionThreadLocal.set(verObj);
|
public void | setObjectKeyFactory(com.sun.corba.se.spi.ior.ObjectKeyFactory factory)
synchronized (objectKeyFactoryAccessLock) {
objectKeyFactory = factory ;
}
|
public void | setResolver(com.sun.corba.se.spi.resolver.Resolver resolver)Set the resolver used in this ORB. This resolver will be used for list_initial_services
and resolve_initial_references.
synchronized (resolverLock) {
this.resolver = resolver ;
}
|
public void | setThreadPoolManager(com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager mgr)
synchronized (threadPoolManagerAccessLock) {
threadpoolMgr = mgr;
}
|
public synchronized void | setTypeCodeForClass(java.lang.Class c, com.sun.corba.se.impl.corba.TypeCodeImpl tci)
if (typeCodeForClassMap == null)
typeCodeForClassMap = Collections.synchronizedMap(
new WeakHashMap(64));
// Store only one TypeCode per class.
if ( ! typeCodeForClassMap.containsKey(c))
typeCodeForClassMap.put(c, tci);
|
public void | setURLOperation(com.sun.corba.se.spi.orb.Operation stringToObject)Set the operation used in string_to_object calls. The Operation must expect a
String and return an org.omg.CORBA.Object.
synchronized (resolverLock) {
urlOperation = stringToObject ;
}
|
public synchronized void | set_delegate(java.lang.Object servant)
checkShutdownState();
POAFactory poaFactory = getPOAFactory() ;
if (poaFactory != null)
((org.omg.PortableServer.Servant)servant)
._set_delegate( poaFactory.getDelegateImpl() ) ;
else
throw wrapper.noPoa() ;
|
public void | set_parameters(java.util.Properties props)
preInit( null, props ) ;
DataCollector dataCollector =
DataCollectorFactory.create( props, getLocalHostName() ) ;
postInit( null, dataCollector ) ;
|
protected void | set_parameters(java.applet.Applet app, java.util.Properties props)
preInit( null, props ) ;
DataCollector dataCollector =
DataCollectorFactory.create( app, props, getLocalHostName() ) ;
postInit( null, dataCollector ) ;
|
protected void | set_parameters(java.lang.String[] params, java.util.Properties props)
preInit( params, props ) ;
DataCollector dataCollector =
DataCollectorFactory.create( params, props, getLocalHostName() ) ;
postInit( params, dataCollector ) ;
|
public void | shutdown(boolean wait_for_completion)
synchronized (this) {
checkShutdownState();
}
// Avoid more than one thread performing shutdown at a time.
synchronized (shutdownObj) {
checkShutdownState();
// This is to avoid deadlock
if (wait_for_completion &&
isProcessingInvocation.get() == Boolean.TRUE) {
throw omgWrapper.shutdownWaitForCompletionDeadlock() ;
}
status = STATUS_SHUTTING_DOWN;
// XXX access to requestDispatcherRegistry should be protected
// by the ORBImpl instance monitor, but is not here in the
// shutdownServants call.
shutdownServants(wait_for_completion);
if (wait_for_completion) {
synchronized ( waitForCompletionObj ) {
while (numInvocations > 0) {
try {
waitForCompletionObj.wait();
} catch (InterruptedException ex) {}
}
}
}
synchronized ( runObj ) {
runObj.notifyAll();
}
status = STATUS_SHUTDOWN;
}
|
protected void | shutdownServants(boolean wait_for_completion)This method shuts down the ORB and causes orb.run() to return.
It will cause all POAManagers to be deactivated, which in turn
will cause all POAs to be deactivated.
Iterator iter = requestDispatcherRegistry.getObjectAdapterFactories().iterator() ;
while (iter.hasNext()) {
ObjectAdapterFactory oaf = (ObjectAdapterFactory)iter.next() ;
oaf.shutdown( wait_for_completion ) ;
}
|
public void | startingDispatch()
synchronized (invocationObj) {
isProcessingInvocation.set(Boolean.TRUE);
numInvocations++;
}
|
public org.omg.CORBA.Object | string_to_object(java.lang.String str)Convert a stringified object reference to the object it represents.
Operation op ;
synchronized (this) {
checkShutdownState();
op = urlOperation ;
}
if (str == null)
throw wrapper.nullParam() ;
synchronized (resolverLock) {
org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
return obj ;
}
|
public synchronized void | unregister_value_factory(java.lang.String repositoryID)Unregisters a value factory for a particular repository ID.
checkShutdownState();
if (valueFactoryCache.remove(repositoryID) == null)
throw wrapper.nullParam() ;
|
public synchronized boolean | work_pending()This method always returns false because the ORB never needs the
main thread to do work.
checkShutdownState();
throw wrapper.genericNoImpl() ;
|