Package com.sun.corba.ee.impl.protocol
Class ServerRequestDispatcherImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl
-
- All Implemented Interfaces:
ServerRequestDispatcher
public class ServerRequestDispatcherImpl extends java.lang.Object implements ServerRequestDispatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected ORB
orb
private static POASystemException
poaWrapper
private static ORBUtilSystemException
wrapper
-
Constructor Summary
Constructors Constructor Description ServerRequestDispatcherImpl(ORB orb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkServerId(ObjectKey okey)
private void
codeSetServiceContextInfo(CodeSetServiceContext csctx)
protected void
consumeServiceContexts(MessageMediator request)
void
dispatch(MessageMediator request)
protected MessageMediator
dispatchToServant(java.lang.Object servant, MessageMediator req, byte[] objectId, ObjectAdapter objectAdapter)
private void
exceptionMessage(java.lang.String msg, java.lang.Throwable thr)
private ObjectAdapter
findObjectAdapter(ObjectKeyTemplate oktemp)
private void
generalMessage(java.lang.String msg)
private java.lang.Object
getServant(ObjectAdapter objectAdapter, byte[] objectId, java.lang.String operation)
protected java.lang.Object
getServantWithPI(MessageMediator request, ObjectAdapter objectAdapter, byte[] objectId, ObjectKeyTemplate oktemp, java.lang.String operation)
protected MessageMediator
handleDynamicResult(ServerRequestImpl sreq, MessageMediator req)
protected void
handleNullServant(java.lang.String operation, NullServant nserv)
Always throws OBJECT_NOT_EXIST if operation is not a special method.IOR
locate(ObjectKey okey)
Called from ORB.locate when a LocateRequest arrives.private void
objectInfo(java.lang.String msg, java.lang.Object obj)
private void
operationAndId(java.lang.String operation, int rid)
protected boolean
processCodeSetContext(MessageMediator request, ServiceContexts contexts)
Handles setting the connection's code sets if required.private void
releaseServant(ObjectAdapter objectAdapter)
protected MessageMediator
sendingReply(MessageMediator req)
protected MessageMediator
sendingReply(MessageMediator req, Any excany)
Must always be called, just after the servant's method returns.
-
-
-
Field Detail
-
wrapper
private static final ORBUtilSystemException wrapper
-
poaWrapper
private static final POASystemException poaWrapper
-
orb
protected ORB orb
-
-
Constructor Detail
-
ServerRequestDispatcherImpl
public ServerRequestDispatcherImpl(ORB orb)
-
-
Method Detail
-
locate
public IOR locate(ObjectKey okey)
Called from ORB.locate when a LocateRequest arrives. Result is not always absolutely correct: may indicate OBJECT_HERE for non-existent objects, which is resolved on invocation. This "bug" is unavoidable, since in general the object may be destroyed between a locate and a request. Note that this only checks that the appropriate ObjectAdapter is available, not that the servant actually exists. Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.- Specified by:
locate
in interfaceServerRequestDispatcher
- Parameters:
okey
- key to object to locate- Returns:
- Result is null if object is (possibly) implemented here, otherwise an IOR indicating objref to forward the request to.
- Throws:
OBJECT_NOT_EXIST
- is thrown if we know the object does not exist here, and we are not forwarding.
-
generalMessage
@InfoMethod private void generalMessage(java.lang.String msg)
-
exceptionMessage
@InfoMethod private void exceptionMessage(java.lang.String msg, java.lang.Throwable thr)
-
dispatch
public void dispatch(MessageMediator request)
- Specified by:
dispatch
in interfaceServerRequestDispatcher
-
releaseServant
private void releaseServant(ObjectAdapter objectAdapter)
-
getServant
private java.lang.Object getServant(ObjectAdapter objectAdapter, byte[] objectId, java.lang.String operation) throws OADestroyed
- Throws:
OADestroyed
-
getServantWithPI
protected java.lang.Object getServantWithPI(MessageMediator request, ObjectAdapter objectAdapter, byte[] objectId, ObjectKeyTemplate oktemp, java.lang.String operation) throws OADestroyed
- Throws:
OADestroyed
-
checkServerId
protected void checkServerId(ObjectKey okey)
-
findObjectAdapter
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
-
handleNullServant
protected void handleNullServant(java.lang.String operation, NullServant nserv)
Always throws OBJECT_NOT_EXIST if operation is not a special method. If operation is _non_existent or _not_existent, this will just return without performing any action, so that _non_existent can return false. Always throws OBJECT_NOT_EXIST for any other special method. Update for issue 4385.- Parameters:
operation
- Name of method to getnserv
- Servant throw associatedException
if not such method exists.
-
objectInfo
@InfoMethod private void objectInfo(java.lang.String msg, java.lang.Object obj)
-
consumeServiceContexts
protected void consumeServiceContexts(MessageMediator request)
-
dispatchToServant
protected MessageMediator dispatchToServant(java.lang.Object servant, MessageMediator req, byte[] objectId, ObjectAdapter objectAdapter)
-
handleDynamicResult
protected MessageMediator handleDynamicResult(ServerRequestImpl sreq, MessageMediator req)
-
sendingReply
protected MessageMediator sendingReply(MessageMediator req)
-
sendingReply
protected MessageMediator sendingReply(MessageMediator req, Any excany)
Must always be called, just after the servant's method returns. Creates the ReplyMessage header and puts in the transaction context if necessary.- Parameters:
req
- original requestexcany
-Any
that contains an exception- Returns:
- Response that contains the exception
-
codeSetServiceContextInfo
@InfoMethod private void codeSetServiceContextInfo(CodeSetServiceContext csctx)
-
processCodeSetContext
protected boolean processCodeSetContext(MessageMediator request, ServiceContexts contexts)
Handles setting the connection's code sets if required. Returns true if the CodeSetContext was in the request, false otherwise.- Parameters:
request
- request to processcontexts
- context to check- Returns:
- if the CodeSetContext was in the request
-
operationAndId
@InfoMethod private void operationAndId(java.lang.String operation, int rid)
-
-