Search in sources :

Example 1 with ServantLocator

use of org.omg.PortableServer.ServantLocator in project Payara by payara.

the class POAProtocolMgr method getRemoteNamingReference.

private org.omg.CORBA.Object getRemoteNamingReference(Remote remoteNamingProvider) {
    final ServantLocator locator = new RemoteNamingServantLocator(orb, remoteNamingProvider);
    final PresentationManager pm = ORB.getPresentationManager();
    String repositoryId;
    try {
        repositoryId = pm.getRepositoryId(remoteNamingProvider);
    } catch (Exception exc) {
        throw new RuntimeException(exc);
    }
    final List<Policy> policies = new ArrayList<Policy>();
    final ReferenceFactory rf = getRFM().create("RemoteSerialContextProvider", repositoryId, policies, locator);
    // arbitrary
    final byte[] oid = { 0, 3, 5, 7, 2, 37, 42 };
    final org.omg.CORBA.Object ref = rf.createReference(oid);
    return ref;
}
Also used : Policy(org.omg.CORBA.Policy) ArrayList(java.util.ArrayList) ServantLocator(org.omg.PortableServer.ServantLocator) TransactionRequiredLocalException(javax.ejb.TransactionRequiredLocalException) TransactionRolledbackLocalException(javax.ejb.TransactionRolledbackLocalException) RemoteException(java.rmi.RemoteException) NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) PresentationManager(com.sun.corba.ee.spi.presentation.rmi.PresentationManager) ReferenceFactory(com.sun.corba.ee.spi.oa.rfm.ReferenceFactory) RemoteReferenceFactory(org.glassfish.enterprise.iiop.api.RemoteReferenceFactory)

Aggregations

ReferenceFactory (com.sun.corba.ee.spi.oa.rfm.ReferenceFactory)1 PresentationManager (com.sun.corba.ee.spi.presentation.rmi.PresentationManager)1 RemoteException (java.rmi.RemoteException)1 ArrayList (java.util.ArrayList)1 NoSuchObjectLocalException (javax.ejb.NoSuchObjectLocalException)1 TransactionRequiredLocalException (javax.ejb.TransactionRequiredLocalException)1 TransactionRolledbackLocalException (javax.ejb.TransactionRolledbackLocalException)1 RemoteReferenceFactory (org.glassfish.enterprise.iiop.api.RemoteReferenceFactory)1 Policy (org.omg.CORBA.Policy)1 ServantLocator (org.omg.PortableServer.ServantLocator)1