⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orbimpl.java

📁 JAVA 所有包
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
		(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 synchronized POAFactory getPOAFactory()     {	if (poaFactory == null) {	    poaFactory = (POAFactory)requestDispatcherRegistry.getObjectAdapterFactory( 		ORBConstants.TRANSIENT_SCID ) ;	}	return poaFactory ;    }    private synchronized TOAFactory getTOAFactory()     {	if (toaFactory == null) {	    toaFactory = (TOAFactory)requestDispatcherRegistry.getObjectAdapterFactory( 		ORBConstants.TOA_SCID ) ;	}	return toaFactory ;    }    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 ) ;    }/**************************************************************************** * The following methods are standard public CORBA ORB APIs ****************************************************************************/    public synchronized org.omg.CORBA.portable.OutputStream create_output_stream()    {        checkShutdownState();        return new EncapsOutputStream(this);    }    /**     * 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");     *     * @return          a Current pseudo-object.     * @deprecated     */    public synchronized org.omg.CORBA.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() ;    }    /**     * Create an NVList     *     * @param count	size of list to create     * @result		NVList created     *     * @see NVList     */    public synchronized NVList create_list(int count)    {        checkShutdownState();        return new NVListImpl(this, count);    }    /**     * Create an NVList corresponding to an OperationDef     *     * @param oper	operation def to use to create list     * @result		NVList created     *     * @see NVList     */    public synchronized NVList create_operation_list(org.omg.CORBA.Object oper)    {        checkShutdownState();	throw wrapper.genericNoImpl() ;    }    /**     * Create a NamedValue     *     * @result		NamedValue created     */    public synchronized NamedValue create_named_value(String s, Any any, int flags)    {        checkShutdownState();        return new NamedValueImpl(this, s, any, flags);    }    /**     * Create an ExceptionList     *     * @result		ExceptionList created     */    public synchronized org.omg.CORBA.ExceptionList create_exception_list()    {        checkShutdownState();        return new ExceptionListImpl();    }    /**     * Create a ContextList     *     * @result		ContextList created     */    public synchronized org.omg.CORBA.ContextList create_context_list()    {        checkShutdownState();        return new ContextListImpl(this);    }    /**     * Get the default Context object     *     * @result		the default Context object     */    public synchronized org.omg.CORBA.Context get_default_context()    {        checkShutdownState();	throw wrapper.genericNoImpl() ;    }    /**     * Create an Environment     *     * @result		Environment created     */    public synchronized org.omg.CORBA.Environment create_environment()    {        checkShutdownState();        return new EnvironmentImpl();    }    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();        }    }    /**     * Send multiple dynamic requests asynchronously.     *     * @param req         an array of request objects.     */    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();        }    }    /**     * Find out if any of the deferred invocations have a response yet.     */    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;    }    /**     * Get the next request that has gotten a response.     *     * @result            the next request ready with a response.     */    public org.omg.CORBA.Request get_next_response()        throws org.omg.CORBA.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();            }        }    }    /**     * Notify response to ORB for get_next_response     */    public void notifyORB()     {	synchronized (this.svResponseReceived) {	    this.svResponseReceived.set();	    this.svResponseReceived.notify();	}    }    /**     * Convert an object ref to a string.     * @param obj The object to stringify.     * @return A stringified object reference.     */    public synchronized String object_to_string(org.omg.CORBA.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 a stringified object reference to the object it represents.     * @param str The stringified object reference.     * @return The unstringified object reference.     */    public org.omg.CORBA.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 ;	}    }    // pure java orb support, moved this method from FVDCodeBaseImpl.    // Note that we connect this if we have not already done so.    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 ) ;    }    /**     * Get the TypeCode for a primitive type.     *     * @param tcKind	the integer kind for the primitive type     * @return		the requested TypeCode     */    public synchronized TypeCode get_primitive_tc(TCKind tcKind)    {        checkShutdownState();	return get_primitive_tc( tcKind.value() ) ;     }    /**     * Create a TypeCode for a structure.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @param members	an array describing the members of the TypeCode.     * @return		the requested TypeCode.     */    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 union.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @param discriminator_type     *			the type of the union discriminator.     * @param members	an array describing the members of the TypeCode.     * @return		the requested TypeCode.     */    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 an enum.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @param members	an array describing the members of the TypeCode.     * @return		the requested TypeCode.     */    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 alias.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @param original_type     * 			the type this is an alias for.     * @return		the requested TypeCode.     */    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 exception.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @param members	an array describing the members of the TypeCode.     * @return		the requested TypeCode.     */    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 interface.     *     * @param id		the logical id for the typecode.     * @param name	the name for the typecode.     * @return		the requested TypeCode.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -