Package fr.dyade.aaa.jndi2.server
Class RequestManager
- java.lang.Object
-
- fr.dyade.aaa.jndi2.server.RequestManager
-
- All Implemented Interfaces:
LifeCycleListener,Serializable
- Direct Known Subclasses:
ReplicationManager
public class RequestManager extends Object implements LifeCycleListener, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Containercontainerprivate ServerImplimplprivate static longserialVersionUIDdefine serialVersionUID for interoperability
-
Constructor Summary
Constructors Constructor Description RequestManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidagentFinalize(boolean lastTime)voidagentInitialize(boolean firstTime)private voidbind(BindRequest request)protected voidchangeOwner(ChangeOwnerRequest request)protected voidcreateSubcontext(CreateSubcontextRequest request)private voiddestroySubcontext(DestroySubcontextRequest request)AgentIdgetId()protected AgentIdgetRootOwnerId()Returns the root naming context owner identifier.protected ServerImplgetServerImpl()JndiReplyinvoke(RequestContext reqCtx)protected JndiReplyinvokeAdminRequest(RequestContext reqCtx)protected JndiReplyinvokeOwner(AgentId owner, RequestContext reqCtx)A centralized JNDI server returns a JNDI error explaining that this server is not the owner of the context on which the JNDI operation is called.protected JndiReplyinvokeReadRequest(RequestContext reqCtx)protected JndiReplyinvokeWriteRequest(RequestContext reqCtx)private NameClassPair[]list(ListRequest request)private Binding[]listBindings(ListBindingsRequest request)private Recordlookup(LookupRequest request)protected JndiReplyonMissingContext(MissingContextException mce, RequestContext reqCtx)In a centralized JNDI server a missing context shows that the naming data are unconsistent.protected JndiReplyonMissingRecord(MissingRecordException mre, RequestContext reqCtx)In a centralized JNDI server a missing record shows that the name asked by the JNDI request doesn't exist.voidsendTo(AgentId to, Notification not)voidsetContainer(Container container)private voidunbind(UnbindRequest request)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
container
private Container container
-
impl
private transient ServerImpl impl
-
-
Method Detail
-
setContainer
public void setContainer(Container container)
-
getId
public final AgentId getId()
-
sendTo
public void sendTo(AgentId to, Notification not)
-
agentInitialize
public void agentInitialize(boolean firstTime) throws Exception- Specified by:
agentInitializein interfaceLifeCycleListener- Throws:
Exception
-
agentFinalize
public void agentFinalize(boolean lastTime)
- Specified by:
agentFinalizein interfaceLifeCycleListener
-
getRootOwnerId
protected AgentId getRootOwnerId()
Returns the root naming context owner identifier. May be overridden by a subclass.- Returns:
- the owner id.
-
getServerImpl
protected final ServerImpl getServerImpl()
-
invoke
public JndiReply invoke(RequestContext reqCtx)
-
invokeReadRequest
protected JndiReply invokeReadRequest(RequestContext reqCtx) throws NamingException
- Throws:
NamingException
-
invokeWriteRequest
protected JndiReply invokeWriteRequest(RequestContext reqCtx) throws NamingException
- Throws:
NamingException
-
invokeAdminRequest
protected JndiReply invokeAdminRequest(RequestContext reqCtx) throws NamingException
- Throws:
NamingException
-
bind
private void bind(BindRequest request) throws NamingException
- Throws:
NamingException
-
unbind
private void unbind(UnbindRequest request) throws NamingException
- Throws:
NamingException
-
lookup
private Record lookup(LookupRequest request) throws NamingException
- Throws:
NamingException
-
list
private NameClassPair[] list(ListRequest request) throws NamingException
- Throws:
NamingException
-
listBindings
private Binding[] listBindings(ListBindingsRequest request) throws NamingException
- Throws:
NamingException
-
createSubcontext
protected void createSubcontext(CreateSubcontextRequest request) throws NamingException
- Throws:
NamingException
-
destroySubcontext
private void destroySubcontext(DestroySubcontextRequest request) throws NamingException
- Throws:
NamingException
-
changeOwner
protected void changeOwner(ChangeOwnerRequest request) throws NamingException
- Throws:
NamingException
-
invokeOwner
protected JndiReply invokeOwner(AgentId owner, RequestContext reqCtx)
A centralized JNDI server returns a JNDI error explaining that this server is not the owner of the context on which the JNDI operation is called. A subclass may override this behavior in order to invoke the owner of the naming context.- Parameters:
owner- the identifier of the naming server that owns the naming context on which the JNDI operation is called.reqCtx- the JNDI request context that raised the exception.- Returns:
- the JNDI reply.
May be
nullif the owner invocation is asynchronous.
-
onMissingContext
protected JndiReply onMissingContext(MissingContextException mce, RequestContext reqCtx)
In a centralized JNDI server a missing context shows that the naming data are unconsistent. So it throws an error. A subclass may override this behavior in order to try to resolve the missing context.- Parameters:
mce- the missing context exceptionreqCtx- the JNDI request context that raised the exception.- Returns:
- the JNDI reply. May be
nullif the resolution is asynchronous.
-
onMissingRecord
protected JndiReply onMissingRecord(MissingRecordException mre, RequestContext reqCtx)
In a centralized JNDI server a missing record shows that the name asked by the JNDI request doesn't exist. So theNameNotFoundExceptionis directly forwarded to the client. A subclass may override this behavior in order to try to resolve the missing record.- Parameters:
mre- the missing context exceptionreqCtx- the JNDI request context that raised the exception.- Returns:
- the JNDI reply. May be
nullif the resolution is asynchronous.
-
-