类org.omg.CORBA.ORB源码实例Demo

下面列出了怎么用org.omg.CORBA.ORB的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-8-source   文件: DynamicStubImpl.java
public Object readResolve()
{
    String repositoryId = ior.getRepositoryId() ;
    String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;

    Class cls = null ;

    try {
        cls = JDKBridge.loadClass( cname, null, null ) ;
    } catch (ClassNotFoundException exc) {
        // XXX log this
    }

    PresentationManager pm =
        com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
    PresentationManager.ClassData classData = pm.getClassData( cls ) ;
    InvocationHandlerFactoryImpl ihfactory =
        (InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
    return ihfactory.getInvocationHandler( this ) ;
}
 
源代码2 项目: hottub   文件: ServerTool.java
public boolean processCommand( String[] cmdArgs, ORB orb, PrintStream out )
{
    if ((cmdArgs.length == 2) && cmdArgs[0].equals( "-applicationName" )) {
        String str = (String)cmdArgs[1] ;

        try {
            Repository repository = RepositoryHelper.narrow(
                orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

            try {
                int result = repository.getServerID( str ) ;
                out.println() ;
                out.println(CorbaResourceUtil.getText("servertool.getserverid2", str, Integer.toString(result)));
                out.println() ;
            } catch (ServerNotRegistered e) {
                out.println(CorbaResourceUtil.getText("servertool.nosuchserver"));
            }
        } catch (Exception ex) {
            ex.printStackTrace() ;
        }

        return commandDone ;
    } else
        return parseError ;
}
 
源代码3 项目: cxf   文件: CorbaUtils.java
private static TypeCode getAnonTypeCode(ORB orb,
                                        QName type,
                                        Object obj,
                                        CorbaTypeMap typeMap,
                                        Stack<QName> seenTypes) {
    TypeCode tc = null;
    if (obj instanceof Anonarray) {
        Anonarray anonArrayType = (Anonarray)obj;
        tc = orb.create_array_tc((int) anonArrayType.getBound(),
                                 getTypeCode(orb, anonArrayType.getElemtype(), typeMap, seenTypes));
    } else if (obj instanceof Anonfixed) {
        Anonfixed anonFixedType = (Anonfixed) obj;
        tc = orb.create_fixed_tc((short) anonFixedType.getDigits(), (short) anonFixedType.getScale());
    } else if (obj instanceof Anonsequence) {
        Anonsequence anonSeqType = (Anonsequence)obj;
        tc = orb.create_sequence_tc((int) anonSeqType.getBound(),
                                    getTypeCode(orb, anonSeqType.getElemtype(), typeMap, seenTypes));
    } else if (obj instanceof Anonstring) {
        Anonstring anonStringType = (Anonstring)obj;
        tc = orb.create_string_tc((int)anonStringType.getBound());
    } else if (obj instanceof Anonwstring) {
        Anonwstring anonWStringType = (Anonwstring)obj;
        tc = orb.create_wstring_tc((int)anonWStringType.getBound());
    }
    return tc;
}
 
源代码4 项目: openjdk-jdk8u   文件: ValueUtility.java
public static TypeCode getPrimitiveTypeCodeForClass (ORB orb,
                                                     Class c,
                                                     ValueHandler vh) {

    if (c == Integer.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_long);
    } else if (c == Byte.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_octet);
    } else if (c == Long.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_longlong);
    } else if (c == Float.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_float);
    } else if (c == Double.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_double);
    } else if (c == Short.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_short);
    } else if (c == Character.TYPE) {
        return orb.get_primitive_tc (((ValueHandlerImpl)vh).getJavaCharTCKind());
    } else if (c == Boolean.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_boolean);
    } else {
        // _REVISIT_ Not sure if this is right.
        return orb.get_primitive_tc (TCKind.tk_any);
    }
}
 
源代码5 项目: hottub   文件: CodecFactoryImpl.java
/**
 * Creates a new CodecFactory implementation.  Stores the ORB that
 * created this factory, for later use by the Codec.
 */
public CodecFactoryImpl( ORB orb ) {
    this.orb = orb;
    wrapper = ORBUtilSystemException.get(
        (com.sun.corba.se.spi.orb.ORB)orb,
        CORBALogDomains.RPC_PROTOCOL ) ;

    // Precreate a codec for version 1.0 through
    // 1.(MAX_MINOR_VERSION_SUPPORTED).  This can be
    // done since Codecs are immutable in their current implementation.
    // This is an optimization that eliminates the overhead of creating
    // a new Codec each time create_codec is called.
    for( int minor = 0; minor <= MAX_MINOR_VERSION_SUPPORTED; minor++ ) {
        codecs[minor] = new CDREncapsCodec( orb, 1, minor );
    }
}
 
源代码6 项目: openjdk-8   文件: TransientNamingContext.java
/**
 * Constructs a new TransientNamingContext object.
 * @param orb an orb object.
 * @param initial the initial naming context.
 * @exception Exception a Java exception thrown of the base class cannot
 * initialize.
 */
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
    org.omg.CORBA.Object initial,
    POA nsPOA )
    throws java.lang.Exception
{
    super(orb, nsPOA );
    wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;

    this.localRoot = initial;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
    lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
 
源代码7 项目: hottub   文件: StubIORImpl.java
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
源代码8 项目: JDKSourceCode1.8   文件: CodecFactoryImpl.java
/**
 * Creates a new CodecFactory implementation.  Stores the ORB that
 * created this factory, for later use by the Codec.
 */
public CodecFactoryImpl( ORB orb ) {
    this.orb = orb;
    wrapper = ORBUtilSystemException.get(
        (com.sun.corba.se.spi.orb.ORB)orb,
        CORBALogDomains.RPC_PROTOCOL ) ;

    // Precreate a codec for version 1.0 through
    // 1.(MAX_MINOR_VERSION_SUPPORTED).  This can be
    // done since Codecs are immutable in their current implementation.
    // This is an optimization that eliminates the overhead of creating
    // a new Codec each time create_codec is called.
    for( int minor = 0; minor <= MAX_MINOR_VERSION_SUPPORTED; minor++ ) {
        codecs[minor] = new CDREncapsCodec( orb, 1, minor );
    }
}
 
源代码9 项目: hottub   文件: ValueUtility.java
private static TypeCode createTypeCodeForClassInternal (ORB orb,
                                                        java.lang.Class c,
                                                        ValueHandler vh,
                                                        IdentityKeyValueStack createdIDs)
{
    // This wrapper method is the protection against infinite recursion.
    TypeCode tc = null;
    String id = (String)createdIDs.get(c);
    if (id != null) {
        return orb.create_recursive_tc(id);
    } else {
        id = vh.getRMIRepositoryID(c);
        if (id == null) id = "";
        // cache the rep id BEFORE creating a new typecode.
        // so that recursive tc can look up the rep id.
        createdIDs.push(c, id);
        tc = createTypeCodeInternal(orb, c, vh, id, createdIDs);
        createdIDs.pop();
        return tc;
    }
}
 
源代码10 项目: cxf   文件: CorbaUtils.java
public static TypeCode getPrimitiveTypeCode(ORB orb, QName type) {
    TCKind kind = PRIMITIVE_TYPECODES.get(type);
    if (kind != null) {
        return orb.get_primitive_tc(kind);
    }

    // There is a possiblitity that the idl type will not have its namespace URI set if it has
    // been read directly from the WSDL file as a string. Try with the standard corba namespace URI.
    if (type.getNamespaceURI() == null) {
        QName uriIdltype = new QName(CorbaConstants.NU_WSDL_CORBA, type.getLocalPart(), type.getPrefix());

        kind = PRIMITIVE_TYPECODES.get(uriIdltype);
        if (kind != null) {
            return orb.get_primitive_tc(kind);
        }
    }
    return null;
}
 
源代码11 项目: hottub   文件: ServerTool.java
public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out)
{
    try {
        Repository repository = RepositoryHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

        String[] applicationNames = repository.getApplicationNames();

        out.println(CorbaResourceUtil.getText("servertool.listappnames2"));
        out.println();
        for (int i=0; i < applicationNames.length; i++)
            out.println( "\t" + applicationNames[i] ) ;
    } catch (Exception ex) {
        ex.printStackTrace();
    }

    return commandDone;
}
 
源代码12 项目: openjdk-8   文件: PersistentBindingIterator.java
/**
  * Constructs a new PersistentBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the PersistentNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public PersistentBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable,
     POA thePOA ) throws java.lang.Exception
 {
     super(orb);
     this.orb = orb;
     theHashtable = aTable;
     theEnumeration = this.theHashtable.keys();
     currentSize = this.theHashtable.size();
     biPOA = thePOA;
 }
 
源代码13 项目: openjdk-jdk9   文件: ServerTool.java
static int getServerIdForAlias( ORB orb, String applicationName ) throws ServerNotRegistered
{
    try {
        Repository rep = RepositoryHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ) ) ;
        int serverid = rep.getServerID(applicationName);

        return rep.getServerID( applicationName ) ;
    } catch (Exception ex) {
        throw (new ServerNotRegistered());
    }
}
 
源代码14 项目: openjdk-jdk8u-backup   文件: Stub.java
/**
 * Connects this stub to an ORB. Required after the stub is deserialized
 * but not after it is demarshalled by an ORB stream. If an unconnected
 * stub is passed to an ORB stream for marshalling, it is implicitly
 * connected to that ORB. Application code should not call this method
 * directly, but should call the portable wrapper method
 * {@link javax.rmi.PortableRemoteObject#connect}.
 * @param orb the ORB to connect to.
 * @exception RemoteException if the stub is already connected to a different
 * ORB, or if the stub does not represent an exported remote or local object.
 */
public void connect(ORB orb) throws RemoteException {

    if (stubDelegate == null) {
        setDefaultDelegate();
    }

    if (stubDelegate != null) {
        stubDelegate.connect(this, orb);
    }

}
 
源代码15 项目: hottub   文件: Util.java
/**
 * Copies or connects an array of objects. Used by local stubs
 * to copy any number of actual parameters, preserving sharing
 * across parameters as necessary to support RMI semantics.
 * @param obj the objects to copy or connect.
 * @param orb the ORB.
 * @return the copied or connected objects.
 * @exception RemoteException if any object could not be copied or connected.
 */
public static Object[] copyObjects (Object[] obj, ORB orb)
    throws RemoteException {

    if (utilDelegate != null) {
        return utilDelegate.copyObjects(obj, orb);
    }

    return null;
}
 
源代码16 项目: openjdk-8-source   文件: StubAdapter.java
public static ORB getORB( Object stub )
{
    if (stub instanceof DynamicStub)
        return ((DynamicStub)stub).getORB() ;
    else if (stub instanceof ObjectImpl)
        return (ORB)((ObjectImpl)stub)._orb() ;
    else
        throw wrapper.getOrbRequiresStub() ;
}
 
源代码17 项目: jdk8u60   文件: StubAdapter.java
public static void connect( Object stub,
    ORB orb ) throws java.rmi.RemoteException
{
    if (stub instanceof DynamicStub)
        ((DynamicStub)stub).connect(
            (com.sun.corba.se.spi.orb.ORB)orb ) ;
    else if (stub instanceof javax.rmi.CORBA.Stub)
        ((javax.rmi.CORBA.Stub)stub).connect( orb ) ;
    else if (stub instanceof ObjectImpl)
        orb.connect( (org.omg.CORBA.Object)stub ) ;
    else
        throw wrapper.connectRequiresStub() ;
}
 
public SocketInfo getEndPointInfo(ORB orb,
                                    IOR ior,
                                    SocketInfo socketInfo)
{
    IIOPProfileTemplate temp =
        (IIOPProfileTemplate)ior.getProfile().getTaggedProfileTemplate() ;
    IIOPAddress primary = temp.getPrimaryAddress() ;

    return new EndPointInfoImpl(ORBSocketFactory.IIOP_CLEAR_TEXT,
                                primary.getPort(),
                                primary.getHost().toLowerCase());
}
 
源代码19 项目: cxf   文件: CorbaExceptionListener.java
public CorbaExceptionListener(CorbaObjectHandler handler,
                              CorbaTypeMap map,
                              ORB orbRef,
                              ServiceInfo serviceInfo) {
    super(handler);
    orb = orbRef;
    typeMap = map;
    sInfo = serviceInfo;
    exMembers = ((Exception) handler.getType()).getMember();
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: StubAdapter.java
public static void connect( Object stub,
    ORB orb ) throws java.rmi.RemoteException
{
    if (stub instanceof DynamicStub)
        ((DynamicStub)stub).connect(
            (com.sun.corba.se.spi.orb.ORB)orb ) ;
    else if (stub instanceof javax.rmi.CORBA.Stub)
        ((javax.rmi.CORBA.Stub)stub).connect( orb ) ;
    else if (stub instanceof ObjectImpl)
        orb.connect( (org.omg.CORBA.Object)stub ) ;
    else
        throw wrapper.connectRequiresStub() ;
}
 
源代码21 项目: cxf   文件: SystemExceptionHelper.java
public TypeCode _type() {
    if (typeCode == null) {
        ORB orb = ORB.init();
        StructMember[] smBuf = new StructMember[2];
        TypeCode minortc = orb.get_primitive_tc(TCKind.tk_long);
        smBuf[0] = new StructMember("minor", minortc, null);

        String[] csLabels = {"COMPLETED_YES", "COMPLETED_NO", "COMPLETED_MAYBE"};
        TypeCode completedtc = orb
            .create_enum_tc("IDL:omg.org/CORBA/CompletionStatus:1.0",
                          "CompletionStatus", csLabels);

        smBuf[1] = new StructMember("completed", completedtc, null);
        String id;
        String name;
        if (value == null) {
            name = "SystemException";
            id = "IDL:omg.org/CORBA/SystemException:1.0";
        } else {
            String className = value.getClass().getName();
            name = className.substring(className.lastIndexOf('.') + 1);
            id = "IDL:omg.org/CORBA/" + name + ":1.0";
        }

        typeCode = orb.create_exception_tc(id, name, smBuf);
    }
    return typeCode;
}
 
源代码22 项目: TencentKona-8   文件: TransientNameService.java
/**
 * Constructs a new TransientNameService, and creates an initial
 * NamingContext, whose object
 * reference can be obtained by the initialNamingContext method.
 * @param orb The ORB object
 * @exception org.omg.CORBA.INITIALIZE Thrown if
 * the TransientNameService cannot initialize.
 */
public TransientNameService(com.sun.corba.se.spi.orb.ORB orb )
    throws org.omg.CORBA.INITIALIZE
{
    // Default constructor uses "NameService" as the key for the Root Naming
    // Context. If default constructor is used then INS's object key for
    // Transient Name Service is "NameService"
    initialize( orb, "NameService" );
}
 
源代码23 项目: cxf   文件: CorbaPrimitiveSequenceEventProducer.java
public CorbaPrimitiveSequenceEventProducer(CorbaObjectHandler h,
                                           ServiceInfo service,
                                           ORB orbRef) {
    CorbaSequenceHandler handler = (CorbaSequenceHandler)h;
    iterator = handler.getElements().iterator();
    orb = orbRef;
    serviceInfo = service;
}
 
源代码24 项目: hottub   文件: ServerTool.java
public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out)
{
    ServerDef serverDef;

    // process the list active servers command
    try {
        Repository repository = RepositoryHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

        Activator activator = ActivatorHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME ));

        int[] servers = activator.getActiveServers();

        out.println(CorbaResourceUtil.getText("servertool.list2"));

        ListServers.sortServers(servers);
        for (int i=0; i < servers.length; i++) {
            try {
                serverDef = repository.getServer(servers[i]);
                out.println("\t   " + servers[i] + "\t\t" +
                            serverDef.serverName + "\t\t" +
                            serverDef.applicationName);
            } catch (ServerNotRegistered e) {}
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }

    return commandDone;
}
 
源代码25 项目: cxf   文件: CorbaAnyEventProducer.java
public CorbaAnyEventProducer(CorbaObjectHandler h, ServiceInfo info, ORB orbRef) {
    handler = (CorbaAnyHandler)h;
    name = handler.getName();
    orb = orbRef;
    serviceInfo = info;

    containedType = getAnyContainedType(handler.getValue());
    handler.setAnyContainedType(containedType);

    if (containedType != null) {
        QName containedSchemaType = convertIdlToSchemaType(containedType);

        XMLEventFactory factory = XMLEventFactory.newInstance();

        attributes = new ArrayList<>();
        attributes.add(factory.createAttribute(new QName(W3CConstants.NU_SCHEMA_XSI, "type"),
                                               ANY_TYPE_PREFIX + ":"
                                               + containedSchemaType.getLocalPart()));
        namespaces = new ArrayList<>();
        namespaces.add(factory.createNamespace(ANY_TYPE_PREFIX,
                                               containedSchemaType.getNamespaceURI()));
    }

    CorbaTypeEventProducer containedProducer =
        CorbaHandlerUtils.getTypeEventProducer(containedType, serviceInfo, orb);
    if (containedProducer instanceof AbstractStartEndEventProducer) {
        iterator = ((AbstractStartEndEventProducer)containedProducer).getNestedTypes();
    } else {
        List<CorbaTypeEventProducer> prods = new ArrayList<>();
        CorbaSimpleAnyContainedTypeEventProducer simpleProducer =
            new CorbaSimpleAnyContainedTypeEventProducer(containedProducer.getText());
        prods.add(simpleProducer);
        producers = prods.iterator();
    }
}
 
源代码26 项目: openjdk-8-source   文件: DefaultSocketFactory.java
public SocketInfo getEndPointInfo(ORB orb,
                                    IOR ior,
                                    SocketInfo socketInfo)
{
    IIOPProfileTemplate temp =
        (IIOPProfileTemplate)ior.getProfile().getTaggedProfileTemplate() ;
    IIOPAddress primary = temp.getPrimaryAddress() ;

    return new EndPointInfoImpl(ORBSocketFactory.IIOP_CLEAR_TEXT,
                                primary.getPort(),
                                primary.getHost().toLowerCase());
}
 
源代码27 项目: jdk8u60   文件: ServerTool.java
public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out)
{
    ServerDef serverDef;

    // process the list active servers command
    try {
        Repository repository = RepositoryHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

        Activator activator = ActivatorHelper.narrow(
            orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME ));

        int[] servers = activator.getActiveServers();

        out.println(CorbaResourceUtil.getText("servertool.list2"));

        ListServers.sortServers(servers);
        for (int i=0; i < servers.length; i++) {
            try {
                serverDef = repository.getServer(servers[i]);
                out.println("\t   " + servers[i] + "\t\t" +
                            serverDef.serverName + "\t\t" +
                            serverDef.applicationName);
            } catch (ServerNotRegistered e) {}
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }

    return commandDone;
}
 
源代码28 项目: openjdk-jdk8u   文件: OrbReuseTracker.java
OrbReuseTracker(ORB orb) {
    this.orb = orb;
    referenceCnt++;
    if (debug) {
         System.out.println("New OrbReuseTracker created");
    }
}
 
源代码29 项目: cxf   文件: CorbaStreamableTest.java
@Before
public void setUp() throws Exception {
    java.util.Properties props = System.getProperties();

    props.put("yoko.orb.id", "CXF-CORBA-Binding");
    orb = ORB.init(new String[0], props);
}
 
源代码30 项目: JDKSourceCode1.8   文件: Stub.java
/**
 * Connects this stub to an ORB. Required after the stub is deserialized
 * but not after it is demarshalled by an ORB stream. If an unconnected
 * stub is passed to an ORB stream for marshalling, it is implicitly
 * connected to that ORB. Application code should not call this method
 * directly, but should call the portable wrapper method
 * {@link javax.rmi.PortableRemoteObject#connect}.
 * @param orb the ORB to connect to.
 * @exception RemoteException if the stub is already connected to a different
 * ORB, or if the stub does not represent an exported remote or local object.
 */
public void connect(ORB orb) throws RemoteException {

    if (stubDelegate == null) {
        setDefaultDelegate();
    }

    if (stubDelegate != null) {
        stubDelegate.connect(this, orb);
    }

}
 
 类所在包
 类方法
 同包方法