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

The following examples show how to use com.sun.corba.se.spi.orb.Operation. These examples are extracted from open source projects. 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 Project: openjdk-8-source   Author: keerath   File: ORBImpl.java    License: 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 Project: hottub   Author: dsrg-uoft   File: ORBImpl.java    License: 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 Project: JDKSourceCode1.8   Author: wupeixuan   File: ORBConfiguratorImpl.java    License: 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 #4
Source Project: jdk8u60   Author: chenghanpeng   File: ParserTable.java    License: 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 #5
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ParserTable.java    License: 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 #6
Source Project: TencentKona-8   Author: Tencent   File: ParserTable.java    License: 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 Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ORBImpl.java    License: 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 #8
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: ORBConfiguratorImpl.java    License: 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 #9
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ORBConfiguratorImpl.java    License: 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 #10
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ORBImpl.java    License: 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 Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ORBImpl.java    License: 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 #12
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: ParserTable.java    License: MIT License 5 votes vote down vote up
private Operation makeMapOperation( final Map map )
{
    return new Operation() {
        public Object operate( Object value )
        {
            return map.get( value ) ;
        }
    } ;
}
 
Example #13
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeInitRefOperation() {
    return new Operation() {
        public Object operate( Object value )
        {
            // Object is String[] of length 2.
            String[] values = (String[])value ;
            if (values.length != 2)
                throw wrapper.orbInitialreferenceSyntax() ;

            return values[0] + "=" + values[1] ;
        }
    } ;
}
 
Example #14
Source Project: openjdk-8-source   Author: keerath   File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeMapOperation( final Map map )
{
    return new Operation() {
        public Object operate( Object value )
        {
            return map.get( value ) ;
        }
    } ;
}
 
Example #15
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ORBInitRefResolverImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ORBInitRefResolverImpl( Operation urlHandler, StringPair[] initRefs )
{
    this.urlHandler = urlHandler ;
    orbInitRefTable = new java.util.HashMap() ;

    for( int i = 0; i < initRefs.length ; i++ ) {
        StringPair sp = initRefs[i] ;
        orbInitRefTable.put( sp.getFirst(), sp.getSecond() ) ;
    }
}
 
Example #16
Source Project: jdk8u60   Author: chenghanpeng   File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeSocketFactoryOperation()
{
    Operation sfop = new Operation() {
        public Object operate( Object value )
        {
            String param = (String)value ;

            try {
                Class<?> socketFactoryClass =
                    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.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
                    return socketFactoryClass.newInstance();
                } else {
                    throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
                }
            } catch (Exception ex) {
                // ClassNotFoundException, IllegalAccessException,
                // InstantiationException, SecurityException or
                // ClassCastException
                throw wrapper.badCustomSocketFactory( ex, param ) ;
            }
        }
    } ;

    return sfop ;
}
 
Example #17
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ParserTable.java    License: Apache License 2.0 5 votes vote down vote up
private Operation makeBMGROperation()
{
    Map map = new HashMap() ;
    map.put( "GROW", new Integer(0) ) ;
    map.put( "CLCT", new Integer(1) ) ;
    map.put( "STRM", new Integer(2) ) ;
    return makeMapOperation( map ) ;
}
 
Example #18
Source Project: openjdk-jdk8u-backup   Author: AdoptOpenJDK   File: ORBDefaultInitRefResolverImpl.java    License: 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 #19
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: PrefixParserAction.java    License: GNU General Public License v2.0 5 votes vote down vote up
public PrefixParserAction( String propertyName,
    Operation operation, String fieldName, Class componentType )
{
    super( propertyName, true, operation, fieldName ) ;
    this.componentType = componentType ;
    this.wrapper = ORBUtilSystemException.get(
        CORBALogDomains.ORB_LIFECYCLE ) ;
}
 
Example #20
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ParserTable.java    License: Apache License 2.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 #21
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ParserTable.java    License: Apache License 2.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 #22
Source Project: jdk8u60   Author: chenghanpeng   File: ORBConfiguratorImpl.java    License: 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 Project: jdk1.8-source-analysis   Author: raysonfang   File: ParserActionBase.java    License: Apache License 2.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 #24
Source Project: hottub   Author: dsrg-uoft   File: ORBImpl.java    License: 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 #25
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: ParserTable.java    License: 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 #26
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: ORBImpl.java    License: Apache License 2.0 5 votes vote down vote up
/** Set the operation used in string_to_object calls.  The Operation must expect a
 * String and return an org.omg.CORBA.Object.
 */
public void setURLOperation( Operation stringToObject )
{
    synchronized (this) {
            checkShutdownState();
    }
    synchronized (urlOperationLock) {
        urlOperation = stringToObject ;
    }
}
 
Example #27
Source Project: openjdk-8-source   Author: keerath   File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeInitRefOperation() {
    return new Operation() {
        public Object operate( Object value )
        {
            // Object is String[] of length 2.
            String[] values = (String[])value ;
            if (values.length != 2)
                throw wrapper.orbInitialreferenceSyntax() ;

            return values[0] + "=" + values[1] ;
        }
    } ;
}
 
Example #28
Source Project: jdk8u60   Author: chenghanpeng   File: ParserTable.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Operation makeMapOperation( final Map map )
{
    return new Operation() {
        public Object operate( Object value )
        {
            return map.get( value ) ;
        }
    } ;
}
 
Example #29
Source Project: jdk1.8-source-analysis   Author: raysonfang   File: PrefixParserData.java    License: 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 #30
Source Project: JDKSourceCode1.8   Author: wupeixuan   File: ParserTable.java    License: 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;
}