| Method from com.sun.corba.se.impl.orb.ORBImpl Detail: |
public void checkShutdownState() {
if (status == STATUS_DESTROYED) {
throw wrapper.orbDestroyed() ;
}
if (status == STATUS_SHUTDOWN) {
throw omgWrapper.badOperationAfterShutdown() ;
}
}
|
public synchronized void connect(Object servant) {
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 ) ;
}
}
This is the implementation of the public API used to connect
a servant-skeleton to the ORB. |
public 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);
startingDispatch();
invocationInfoStack.push(clientInvocationInfo);
}
// Reset retry so recursive calls will get a new info object.
clientInvocationInfo.setIsRetryInvocation(false);
clientInvocationInfo.incrementEntryCount();
return clientInvocationInfo;
}
|
public synchronized TypeCode create_abstract_interface_tc(String id,
String name) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name);
}
|
public synchronized TypeCode create_alias_tc(String id,
String name,
TypeCode original_type) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type);
}
Create a TypeCode for an alias. |
public synchronized Any create_any() {
checkShutdownState();
return new AnyImpl(this);
}
|
public synchronized TypeCode create_array_tc(int length,
TypeCode element_type) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_array, length, element_type);
}
Create a TypeCode for an array. |
public synchronized ContextList create_context_list() {
checkShutdownState();
return new ContextListImpl(this);
}
|
public synchronized TypeCode create_enum_tc(String id,
String name,
String[] members) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members);
}
Create a TypeCode for an enum. |
public synchronized Environment create_environment() {
checkShutdownState();
return new EnvironmentImpl();
}
|
public synchronized ExceptionList create_exception_list() {
checkShutdownState();
return new ExceptionListImpl();
}
|
public synchronized TypeCode create_exception_tc(String id,
String name,
StructMember[] members) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_except, id, name, members);
}
Create a TypeCode for an exception. |
public synchronized TypeCode create_fixed_tc(short digits,
short scale) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
}
|
public synchronized TypeCode create_interface_tc(String id,
String name) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_objref, id, name);
}
Create a TypeCode for an interface. |
public synchronized NVList create_list(int count) {
checkShutdownState();
return new NVListImpl(this, count);
}
|
public synchronized NamedValue create_named_value(String s,
Any any,
int flags) {
checkShutdownState();
return new NamedValueImpl(this, s, any, flags);
}
|
public synchronized TypeCode create_native_tc(String id,
String name) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
|
public synchronized NVList create_operation_list(Object oper) {
checkShutdownState();
throw wrapper.genericNoImpl() ;
}
Create an NVList corresponding to an OperationDef |
public synchronized OutputStream create_output_stream() {
checkShutdownState();
return new EncapsOutputStream(this);
}
The following methods are standard public CORBA ORB APIs |
public synchronized Policy create_policy(int type,
Any val) throws PolicyError {
checkShutdownState() ;
return pihandler.create_policy( type, val ) ;
}
|
public synchronized TypeCode create_recursive_sequence_tc(int bound,
int offset) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset);
}
Create a recursive TypeCode in a sequence. |
public synchronized TypeCode create_recursive_tc(String id) {
checkShutdownState();
return new TypeCodeImpl(this, id);
}
|
public synchronized TypeCode create_sequence_tc(int bound,
TypeCode element_type) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
}
Create a TypeCode for a sequence. |
public synchronized TypeCode create_string_tc(int bound) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_string, bound);
}
Create a TypeCode for a string. |
public synchronized TypeCode create_struct_tc(String id,
String name,
StructMember[] members) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_struct, id, name, members);
}
Create a TypeCode for a structure. |
public synchronized TypeCode create_union_tc(String id,
String name,
TypeCode discriminator_type,
UnionMember[] members) {
checkShutdownState();
return new TypeCodeImpl(this,
TCKind._tk_union,
id,
name,
discriminator_type,
members);
}
Create a TypeCode for a union. |
public synchronized TypeCode create_value_box_tc(String id,
String name,
TypeCode boxed_type) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_value_box, id, name,
boxed_type);
}
|
public synchronized TypeCode create_value_tc(String id,
String name,
short type_modifier,
TypeCode concrete_base,
ValueMember[] members) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_value, id, name,
type_modifier, concrete_base, members);
}
|
public synchronized TypeCode create_wstring_tc(int bound) {
checkShutdownState();
return new TypeCodeImpl(this, TCKind._tk_wstring, bound);
}
Create a TypeCode for a wide string. |
public synchronized void destroy() {
if (status == STATUS_OPERATING) {
shutdown(true);
}
getCorbaTransportManager().close();
getPIHandler().destroyInterceptors() ;
status = STATUS_DESTROYED;
}
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." |
public synchronized void disconnect(Object obj) {
checkShutdownState();
if (getTOAFactory() == null)
throw wrapper.noToa() ;
try {
getTOAFactory().getTOA().disconnect( obj ) ;
} catch ( Exception ex ) {
throw wrapper.orbConnectError( ex ) ;
}
}
|
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 ClientDelegateFactory getClientDelegateFactory() {
synchronized (clientDelegateFactoryAccessorLock) {
return clientDelegateFactory ;
}
}
|
public CopierManager getCopierManager() {
return copierManager ;
}
|
public synchronized CorbaContactInfoListFactory getCorbaContactInfoListFactory() {
return corbaContactInfoListFactory ;
}
|
public CorbaTransportManager getCorbaTransportManager() {
return (CorbaTransportManager) getTransportManager();
}
|
public synchronized 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 ) ;
}
|
public ClientInvocationInfo getInvocationInfo() {
StackImpl invocationInfoStack =
(StackImpl) clientInvocationInfoStack.get();
return (ClientInvocationInfo) invocationInfoStack.peek();
}
|
public LegacyServerSocketManager getLegacyServerSocketManager() {
synchronized (legacyServerSocketManagerAccessLock) {
if (legacyServerSocketManager == null) {
legacyServerSocketManager = new LegacyServerSocketManagerImpl(this);
}
return legacyServerSocketManager;
}
}
|
public LocalResolver getLocalResolver() {
synchronized (resolverLock) {
return localResolver ;
}
}
Get the LocalResolver used in this ORB. This LocalResolver is used for
register_initial_reference only. |
public ORBData getORBData() {
return configData ;
}
|
public ORBVersion getORBVersion() {
return (ORBVersion)(orbVersionThreadLocal.get()) ;
}
|
public ObjectKeyFactory getObjectKeyFactory() {
synchronized (objectKeyFactoryAccessLock) {
return objectKeyFactory ;
}
}
|
public PIHandler getPIHandler() {
return pihandler ;
}
|
public RequestDispatcherRegistry getRequestDispatcherRegistry() {
return requestDispatcherRegistry;
}
|
public Resolver getResolver() {
synchronized (resolverLock) {
return resolver ;
}
}
Get the resolver used in this ORB. This resolver will be used for list_initial_services
and resolve_initial_references. |
public ServiceContextRegistry getServiceContextRegistry() {
return serviceContextRegistry ;
}
|
public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() {
return taggedComponentFactoryFinder ;
}
|
public IdentifiableFactoryFinder getTaggedProfileFactoryFinder() {
return taggedProfileFactoryFinder ;
}
|
public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() {
return taggedProfileTemplateFactoryFinder ;
}
|
public 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 TransportManager getTransportManager() {
synchronized (transportManagerAccessorLock) {
if (transportManager == null) {
transportManager = new CorbaTransportManagerImpl(this);
}
return transportManager;
}
}
|
public synchronized TypeCodeImpl getTypeCodeForClass(Class c) {
if (typeCodeForClassMap == null)
return null;
return (TypeCodeImpl)typeCodeForClassMap.get(c);
}
|
public Operation getURLOperation() {
synchronized (resolverLock) {
return urlOperation ;
}
}
Get the operation used in string_to_object calls. The Operation must expect a
String and return an org.omg.CORBA.Object. |
public synchronized Current get_current() {
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() ;
} Deprecated!
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"); |
public synchronized Context get_default_context() {
checkShutdownState();
throw wrapper.genericNoImpl() ;
}
Get the default Context object |
public Request get_next_response() throws WrongTransaction {
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();
}
}
}
Get the next request that has gotten a response. |
public synchronized TypeCode get_primitive_tc(TCKind tcKind) {
checkShutdownState();
return get_primitive_tc( tcKind.value() ) ;
}
Get the TypeCode for a primitive type. |
public void handleBadServerId(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(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 String[] list_initial_services() {
Resolver res ;
synchronized( this ) {
checkShutdownState();
res = resolver ;
}
synchronized (resolverLock) {
java.util.Set keys = res.list() ;
return (String[])keys.toArray( new String[keys.size()] ) ;
}
}
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. |
public synchronized ValueFactory lookup_value_factory(String repositoryID) {
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 ;
}
Finds and returns a value factory for the given repository ID.
The value factory returned was previously registered by a call to
#register_value_factory or is the default factory. |
public void notifyORB() {
synchronized (this.svResponseReceived) {
this.svResponseReceived.set();
this.svResponseReceived.notify();
}
}
Notify response to ORB for get_next_response |
public synchronized String object_to_string(Object obj) {
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() ;
}
Convert an object ref to a string. |
public OAInvocationInfo peekInvocationInfo() {
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
return (OAInvocationInfo)(stack.peek()) ;
}
|
public synchronized void perform_work() {
checkShutdownState();
throw wrapper.genericNoImpl() ;
}
This method does nothing. It is not required by the spec to do anything! |
public synchronized boolean poll_next_response() {
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;
}
Find out if any of the deferred invocations have a response yet. |
public OAInvocationInfo popInvocationInfo() {
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
return (OAInvocationInfo)(stack.pop()) ;
}
|
public void pushInvocationInfo(OAInvocationInfo info) {
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
stack.push( info ) ;
}
|
public void register_initial_reference(String id,
Object obj) throws InvalidName {
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 ) ;
}
}
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. |
public synchronized ValueFactory register_value_factory(String repositoryID,
ValueFactory factory) {
checkShutdownState();
if ((repositoryID == null) || (factory == null))
throw omgWrapper.unableRegisterValueFactory() ;
return (ValueFactory)valueFactoryCache.put(repositoryID, factory);
}
Registers a value factory for a particular repository ID. |
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();
finishedDispatch();
}
}
|
public Object resolve_initial_references(String identifier) throws InvalidName {
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 ;
}
}
Resolve the stringified reference of one of the initially
available CORBA services. |
public void run() {
synchronized (this) {
checkShutdownState();
}
synchronized (runObj) {
try {
runObj.wait();
} catch ( InterruptedException ex ) {}
}
}
The following methods (introduced in POA / CORBA2.1) deal with
shutdown / single threading. |
public synchronized void send_multiple_requests_deferred(Request[] req) {
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();
}
}
Send multiple dynamic requests asynchronously. |
public synchronized void send_multiple_requests_oneway(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(BadServerIdHandler handler) {
synchronized (badServerIdHandlerAccessLock) {
badServerIdHandler = handler;
}
}
|
public void setClientDelegateFactory(ClientDelegateFactory factory) {
synchronized (clientDelegateFactoryAccessorLock) {
clientDelegateFactory = factory ;
}
}
|
public void setCorbaContactInfoListFactory(CorbaContactInfoListFactory factory) {
synchronized (corbaContactInfoListFactoryAccessLock) {
corbaContactInfoListFactory = factory ;
}
}
|
protected void setDebugFlags(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(CorbaServerRequestDispatcher sdel) {
synchronized (resolverLock) {
insNamingDelegate = sdel ;
}
}
|
public void setLocalResolver(LocalResolver resolver) {
synchronized (resolverLock) {
this.localResolver = resolver ;
}
}
Set the LocalResolver used in this ORB. This LocalResolver is used for
register_initial_reference only. |
public void setORBVersion(ORBVersion verObj) {
orbVersionThreadLocal.set(verObj);
}
|
public void setObjectKeyFactory(ObjectKeyFactory factory) {
synchronized (objectKeyFactoryAccessLock) {
objectKeyFactory = factory ;
}
}
|
public void setResolver(Resolver resolver) {
synchronized (resolverLock) {
this.resolver = resolver ;
}
}
Set the resolver used in this ORB. This resolver will be used for list_initial_services
and resolve_initial_references. |
public void setThreadPoolManager(ThreadPoolManager mgr) {
synchronized (threadPoolManagerAccessLock) {
threadpoolMgr = mgr;
}
}
|
public synchronized void setTypeCodeForClass(Class c,
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(Operation stringToObject) {
synchronized (resolverLock) {
urlOperation = stringToObject ;
}
}
Set the operation used in string_to_object calls. The Operation must expect a
String and return an org.omg.CORBA.Object. |
public synchronized void set_delegate(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(Properties props) {
preInit( null, props ) ;
DataCollector dataCollector =
DataCollectorFactory.create( props, getLocalHostName() ) ;
postInit( null, dataCollector ) ;
}
|
protected void set_parameters(Applet app,
Properties props) {
preInit( null, props ) ;
DataCollector dataCollector =
DataCollectorFactory.create( app, props, getLocalHostName() ) ;
postInit( null, dataCollector ) ;
}
|
protected void set_parameters(String[] params,
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) {
Iterator iter = requestDispatcherRegistry.getObjectAdapterFactories().iterator() ;
while (iter.hasNext()) {
ObjectAdapterFactory oaf = (ObjectAdapterFactory)iter.next() ;
oaf.shutdown( 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. |
public void startingDispatch() {
synchronized (invocationObj) {
isProcessingInvocation.set(Boolean.TRUE);
numInvocations++;
}
}
|
public Object string_to_object(String str) {
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 ;
}
}
Convert a stringified object reference to the object it represents. |
public synchronized void unregister_value_factory(String repositoryID) {
checkShutdownState();
if (valueFactoryCache.remove(repositoryID) == null)
throw wrapper.nullParam() ;
}
Unregisters a value factory for a particular repository ID. |
public synchronized boolean work_pending() {
checkShutdownState();
throw wrapper.genericNoImpl() ;
}
This method always returns false because the ORB never needs the
main thread to do work. |