Methods Summary |
---|
public void | connectObject(java.rmi.Remote remoteObj)Connect the RMI object to the protocol.
StubAdapter.connect
(remoteObj, (com.sun.corba.ee.spi.orb.ORB)ORBManager.getORB());
|
private ContainerFactory | getContainerFactory()
return containerFactory;
|
public EjbDescriptor | getEjbDescriptor(byte[] ejbKey)Called from SecurityMechanismSelector for each objref creation
EjbDescriptor result = null;
try {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "POAProtocolMgr.getEjbDescriptor->: "
+ ejbKey);
}
if ( ejbKey.length < POARemoteReferenceFactory.EJBID_OFFSET + 8 ) {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "POAProtocolMgr.getEjbDescriptor: "
+ ejbKey
+ ": " + ejbKey.length + " < "
+ POARemoteReferenceFactory.EJBID_OFFSET + 8);
}
return null;
}
long ejbId =
Utility.bytesToLong(ejbKey,
POARemoteReferenceFactory.EJBID_OFFSET);
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "POAProtocolMgr.getEjbDescriptor: "
+ ejbKey + ": ejbId: " + ejbId);
}
if ( getContainerFactory() != null ) {
result = containerFactory.getEjbDescriptor(ejbId);
} else {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "POAProtocolMgr.getEjbDescriptor: "
+ ejbKey + ": no container factory");
}
}
return result;
} finally {
if(_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "POAProtocolMgr.getEjbDescriptor<-: "
+ ejbKey + ": " + result);
}
}
|
public ORB | getORB()
return orb;
|
public RemoteReferenceFactory | getRemoteReferenceFactory(Container container, boolean remoteHomeView, java.lang.String id)Return a factory that can be used to create/destroy remote
references for a particular EJB type.
RemoteReferenceFactory factory = new POARemoteReferenceFactory
(container, this, orb, remoteHomeView, id);
// XXX store factory in some kind of table ??
return factory;
|
public void | initializeNaming(java.io.File dbDir, int orbInitialPort)
// NOTE: The TransientNameService reference is NOT HA.
new TransientNameService((com.sun.corba.ee.spi.orb.ORB)orb);
_logger.log(Level.FINE, "POAProtocolMgr.initializeNaming: complete");
|
public void | initializePOAs()
// NOTE: The RootPOA manager used to activated here.
ReferenceFactoryManager rfm =
(ReferenceFactoryManager)orb.resolve_initial_references(
ORBConstants.REFERENCE_FACTORY_MANAGER ) ;
rfm.activate() ;
_logger.log(Level.FINE, "POAProtocolMgr.initializePOAs: RFM resolved and activated");
|
public boolean | isIdentical(java.rmi.Remote obj1, java.rmi.Remote obj2)Return true if the two object references refer to the same
remote object.
org.omg.CORBA.Object corbaObj1 = (org.omg.CORBA.Object)obj1;
org.omg.CORBA.Object corbaObj2 = (org.omg.CORBA.Object)obj2;
return corbaObj1._is_equivalent(corbaObj2);
|
public java.lang.Throwable | mapException(java.lang.Throwable exception)Map the EJB/RMI exception to a protocol-specific (e.g. CORBA) exception
boolean mapped = true;
Throwable mappedException = null;
if ( exception instanceof java.rmi.NoSuchObjectException
|| exception instanceof NoSuchObjectLocalException )
{
mappedException = new OBJECT_NOT_EXIST(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if ( exception instanceof java.rmi.AccessException
|| exception instanceof javax.ejb.AccessLocalException )
{
mappedException = new NO_PERMISSION(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if ( exception instanceof java.rmi.MarshalException ) {
mappedException = new MARSHAL(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if ( exception instanceof javax.transaction.TransactionRolledbackException
|| exception instanceof TransactionRolledbackLocalException )
{
mappedException = new TRANSACTION_ROLLEDBACK(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if ( exception instanceof javax.transaction.TransactionRequiredException
|| exception instanceof TransactionRequiredLocalException )
{
mappedException = new TRANSACTION_REQUIRED(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if ( exception instanceof javax.transaction.InvalidTransactionException ) {
mappedException = new INVALID_TRANSACTION(MAPEXCEPTION_CODE,
CompletionStatus.COMPLETED_MAYBE);
} else if (exception instanceof ConcurrentAccessException) {
ConcurrentAccessException ex = (ConcurrentAccessException) exception;
exception = new ParallelAccessException(ex.getMessage(), ex);
mapped = false;
} else if ( exception instanceof EJBException ) {
EJBException ex = (EJBException) exception;
Throwable cause = ex.getCausedByException();
if(cause == null) {
cause = ex.getCause();
}
exception = new RemoteException(ex.getMessage(), cause);
mapped = false;
} else {
mapped = false;
}
return (mapped)
? mappedException.initCause(exception)
: exception;
|
public void | validateTargetObjectInterfaces(java.rmi.Remote targetObj)
if( targetObj != null ) {
// All Remote interfaces implemented by targetObj will be
// validated as a side-effect of calling setTarget().
// A runtime exception will be propagated if validation fails.
Tie tie = presentationMgr.getTie();
tie.setTarget(targetObj);
} else {
throw new IllegalArgumentException
("null passed to validateTargetObjectInterfaces");
}
|