com.sun.corba.se.spi.orb.Operation Java Examples

The following examples show how to use com.sun.corba.se.spi.orb.Operation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ORBImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 (urlOperationLock) {
        org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
        return obj ;
    }
}
 
Example #2
Source File: ORBImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 (urlOperationLock) {
        org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
        return obj ;
    }
}
 
Example #3
Source File: ORBConfiguratorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void initializeNaming( ORB orb )
{
    LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
    orb.setLocalResolver( localResolver ) ;

    Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
        orb.getORBData().getORBInitialHost(),
        orb.getORBData().getORBInitialPort() ) ;

    Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
        bootResolver ) ;
    orb.setURLOperation( urlOperation ) ;

    Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
        orb.getORBData().getORBInitialReferences() ) ;

    Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
        urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;

    Resolver resolver =
        ResolverDefault.makeCompositeResolver( localResolver,
            ResolverDefault.makeCompositeResolver( irResolver,
                ResolverDefault.makeCompositeResolver( dirResolver,
                    bootResolver ) ) ) ;
    orb.setResolver( resolver ) ;
}
 
Example #4
Source File: ORBConfiguratorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void initializeNaming( ORB orb )
{
    LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
    orb.setLocalResolver( localResolver ) ;

    Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
        orb.getORBData().getORBInitialHost(),
        orb.getORBData().getORBInitialPort() ) ;

    Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
        bootResolver ) ;
    orb.setURLOperation( urlOperation ) ;

    Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
        orb.getORBData().getORBInitialReferences() ) ;

    Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
        urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;

    Resolver resolver =
        ResolverDefault.makeCompositeResolver( localResolver,
            ResolverDefault.makeCompositeResolver( irResolver,
                ResolverDefault.makeCompositeResolver( dirResolver,
                    bootResolver ) ) ) ;
    orb.setResolver( resolver ) ;
}
 
Example #5
Source File: ORBImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 (urlOperationLock) {
        org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
        return obj ;
    }
}
 
Example #6
Source File: ParserTable.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private Operation makeUSLOperation()
{
    Operation[] siop = { OperationFactory.stringAction(),
        OperationFactory.integerAction() } ;
    Operation op2 = OperationFactory.sequenceAction( ":", siop ) ;

    Operation uslop = new Operation() {
        public Object operate( Object value )
        {
            Object[] values = (Object[])value ;
            String type = (String)(values[0]) ;
            Integer port = (Integer)(values[1]) ;
            return new USLPort( type, port.intValue() ) ;
        }
    } ;

    Operation op3 = OperationFactory.compose( op2, uslop ) ;
    Operation listenop = OperationFactory.listAction( ",", op3 ) ;
    return listenop ;
}
 
Example #7
Source File: ParserTable.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private Operation makeFSOperation() {
    Operation fschecker = new Operation() {
        public Object operate( Object value )
        {
            int giopFragmentSize = ((Integer)value).intValue() ;
            if (giopFragmentSize < ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE){
                throw wrapper.fragmentSizeMinimum( new Integer( giopFragmentSize ),
                    new Integer( ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE ) ) ;
            }

            if (giopFragmentSize % ORBConstants.GIOP_FRAGMENT_DIVISOR != 0)
                throw wrapper.fragmentSizeDiv( new Integer( giopFragmentSize ),
                        new Integer( ORBConstants.GIOP_FRAGMENT_DIVISOR ) ) ;

            return value ;
        }
    } ;

    Operation result = OperationFactory.compose( OperationFactory.integerAction(),
        fschecker ) ;
    return result ;
}
 
Example #8
Source File: ParserTable.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private Operation makeGVOperation() {
    Operation gvHelper = OperationFactory.listAction( ".",
        OperationFactory.integerAction() ) ;
    Operation gvMain = new Operation() {
        public Object operate( Object value )
        {
            Object[] nums = (Object[])value ;
            int major = ((Integer)(nums[0])).intValue() ;
            int minor = ((Integer)(nums[1])).intValue() ;

            return new GIOPVersion( major, minor ) ;
        }
    } ;

    Operation result = OperationFactory.compose( gvHelper, gvMain );
    return result ;
}
 
Example #9
Source File: ORBConfiguratorImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private void initializeNaming( ORB orb )
{
    LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
    orb.setLocalResolver( localResolver ) ;

    Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
        orb.getORBData().getORBInitialHost(),
        orb.getORBData().getORBInitialPort() ) ;

    Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
        bootResolver ) ;
    orb.setURLOperation( urlOperation ) ;

    Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
        orb.getORBData().getORBInitialReferences() ) ;

    Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
        urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;

    Resolver resolver =
        ResolverDefault.makeCompositeResolver( localResolver,
            ResolverDefault.makeCompositeResolver( irResolver,
                ResolverDefault.makeCompositeResolver( dirResolver,
                    bootResolver ) ) ) ;
    orb.setResolver( resolver ) ;
}
 
Example #10
Source File: ORBImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 (urlOperationLock) {
        org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
        return obj ;
    }
}
 
Example #11
Source File: ParserTable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeTTCPRTOperation()
{
    Operation[] fourIop = { OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction() } ;

    Operation op2 = OperationFactory.sequenceAction( ":", fourIop ) ;

    Operation rtOp = new Operation() {
        public Object operate(Object value)
        {
            Object[] values = (Object[])value ;
            Integer initialTime = (Integer)(values[0]) ;
            Integer maxGIOPHdrTime = (Integer)(values[1]) ;
            Integer maxGIOPBodyTime = (Integer)(values[2]) ;
            Integer backoffPercent = (Integer)(values[3]) ;
            return TransportDefault.makeReadTimeoutsFactory().create(
                                               initialTime.intValue(),
                                               maxGIOPHdrTime.intValue(),
                                               maxGIOPBodyTime.intValue(),
                                               backoffPercent.intValue());
        }
    } ;

    Operation ttcprtOp = OperationFactory.compose(op2, rtOp);
    return ttcprtOp;
}
 
Example #12
Source File: ParserTable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example #13
Source File: ORBDefaultInitRefResolverImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public ORBDefaultInitRefResolverImpl( Operation urlHandler, String orbDefaultInitRef )
{
    this.urlHandler = urlHandler ;

    // XXX Validate the URL?
    this.orbDefaultInitRef = orbDefaultInitRef ;
}
 
Example #14
Source File: ParserTable.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example #15
Source File: ParserTable.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeIIOPPrimaryToContactInfoOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> iiopPrimaryToContactInfoClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
                    return iiopPrimaryToContactInfoClass.newInstance();
                } else {
                    throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example #16
Source File: ParserActionBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ParserActionBase( String propertyName, boolean prefix,
    Operation operation, String fieldName )
{
    this.propertyName       = propertyName ;
    this.prefix             = prefix ;
    this.operation          = operation ;
    this.fieldName          = fieldName ;
}
 
Example #17
Source File: ParserTable.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeTTCPRTOperation()
{
    Operation[] fourIop = { OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction() } ;

    Operation op2 = OperationFactory.sequenceAction( ":", fourIop ) ;

    Operation rtOp = new Operation() {
        public Object operate(Object value)
        {
            Object[] values = (Object[])value ;
            Integer initialTime = (Integer)(values[0]) ;
            Integer maxGIOPHdrTime = (Integer)(values[1]) ;
            Integer maxGIOPBodyTime = (Integer)(values[2]) ;
            Integer backoffPercent = (Integer)(values[3]) ;
            return TransportDefault.makeReadTimeoutsFactory().create(
                                               initialTime.intValue(),
                                               maxGIOPHdrTime.intValue(),
                                               maxGIOPBodyTime.intValue(),
                                               backoffPercent.intValue());
        }
    } ;

    Operation ttcprtOp = OperationFactory.compose(op2, rtOp);
    return ttcprtOp;
}
 
Example #18
Source File: ParserTable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example #19
Source File: ParserTable.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeContactInfoListFactoryOperation()
{
    Operation op = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> contactInfoListFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (CorbaContactInfoListFactory.class.isAssignableFrom(
                    contactInfoListFactoryClass)) {
                    return contactInfoListFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalContactInfoListFactoryType(
                        contactInfoListFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badContactInfoListFactory( ex, param ) ;
            }
        }
    } ;

    return op ;
}
 
Example #20
Source File: ParserTable.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeLegacySocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> legacySocketFactoryClass =
                    SharedSecrets.getJavaCorbaAccess().loadClass(param);
                // For security reasons avoid creating an instance if
                // this socket factory class is not one that would fail
                // the class cast anyway.
                if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
                    return legacySocketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example #21
Source File: ORBDefaultInitRefResolverImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ORBDefaultInitRefResolverImpl( Operation urlHandler, String orbDefaultInitRef )
{
    this.urlHandler = urlHandler ;

    // XXX Validate the URL?
    this.orbDefaultInitRef = orbDefaultInitRef ;
}
 
Example #22
Source File: ORBConfiguratorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public PropertyParser makeParser()
{
    PropertyParser parser = new PropertyParser() ;
    Operation action = OperationFactory.compose(
        OperationFactory.suffixAction(),
        OperationFactory.classAction()
    ) ;
    parser.addPrefix( ORBConstants.SUN_PREFIX + "ORBUserConfigurators",
        action, "userConfigurators", Class.class ) ;
    return parser ;
}
 
Example #23
Source File: ORBImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Get the operation used in string_to_object calls.  The Operation must expect a
 * String and return an org.omg.CORBA.Object.
 */
public Operation getURLOperation()
{
    synchronized (this) {
            checkShutdownState();
    }
    synchronized (urlOperationLock) {
        return urlOperation ;
    }
}
 
Example #24
Source File: ParserTable.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private Operation makeCSOperation()
{
    Operation csop = new Operation() {
        public Object operate( Object value )
        {
            String val = (String)value ;
            return CodeSetComponentInfo.createFromString( val ) ;
        }
    } ;

    return csop ;
}
 
Example #25
Source File: ParserActionBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ParserActionBase( String propertyName, boolean prefix,
    Operation operation, String fieldName )
{
    this.propertyName       = propertyName ;
    this.prefix             = prefix ;
    this.operation          = operation ;
    this.fieldName          = fieldName ;
}
 
Example #26
Source File: ParserActionBase.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public ParserActionBase( String propertyName, boolean prefix,
    Operation operation, String fieldName )
{
    this.propertyName       = propertyName ;
    this.prefix             = prefix ;
    this.operation          = operation ;
    this.fieldName          = fieldName ;
}
 
Example #27
Source File: ParserTable.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private Operation makeTTCPRTOperation()
{
    Operation[] fourIop = { OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction(),
                            OperationFactory.integerAction() } ;

    Operation op2 = OperationFactory.sequenceAction( ":", fourIop ) ;

    Operation rtOp = new Operation() {
        public Object operate(Object value)
        {
            Object[] values = (Object[])value ;
            Integer initialTime = (Integer)(values[0]) ;
            Integer maxGIOPHdrTime = (Integer)(values[1]) ;
            Integer maxGIOPBodyTime = (Integer)(values[2]) ;
            Integer backoffPercent = (Integer)(values[3]) ;
            return TransportDefault.makeReadTimeoutsFactory().create(
                                               initialTime.intValue(),
                                               maxGIOPHdrTime.intValue(),
                                               maxGIOPBodyTime.intValue(),
                                               backoffPercent.intValue());
        }
    } ;

    Operation ttcprtOp = OperationFactory.compose(op2, rtOp);
    return ttcprtOp;
}
 
Example #28
Source File: PrefixParserData.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public PrefixParserData( String  propertyName,
    Operation operation, String fieldName, Object defaultValue,
    Object testValue, StringPair[] testData, Class componentType )
{
    super( propertyName, operation, fieldName, defaultValue, testValue ) ;
    this.testData = testData ;
    this.componentType = componentType ;
}
 
Example #29
Source File: ORBDefaultInitRefResolverImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ORBDefaultInitRefResolverImpl( Operation urlHandler, String orbDefaultInitRef )
{
    this.urlHandler = urlHandler ;

    // XXX Validate the URL?
    this.orbDefaultInitRef = orbDefaultInitRef ;
}
 
Example #30
Source File: PrefixParserData.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public PrefixParserData( String  propertyName,
    Operation operation, String fieldName, Object defaultValue,
    Object testValue, StringPair[] testData, Class componentType )
{
    super( propertyName, operation, fieldName, defaultValue, testValue ) ;
    this.testData = testData ;
    this.componentType = componentType ;
}