public class ReplicationManager extends RequestManager implements UpdateListener
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ReplicationManager.RequestContextList |
Modifier and Type | Field and Description |
---|---|
static String |
INIT_REQUEST_TABLE |
private Hashtable |
initRequestContextLists
Table that contains the requests (read or write) waiting for the initialization of the context.
|
private boolean |
looseCoupling |
private AgentId |
rootOwnerId
Identifier of the server that owns the root naming context.
|
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
static String |
SERVER_LIST |
private short[] |
serverIds
List of the initially known servers.
|
private Vector |
servers
List of the JNDI servers discovered by this server.
|
static String |
SYNC_REQUEST_TABLE |
private Hashtable |
syncRequestContextLists
Table that contains the requests (read or write) waiting for the synchronization of the context.
|
static String |
WRITE_REQUEST_TABLE |
private Hashtable |
writeRequestContextLists
Table that contains the write requests forwarded to the owner.
|
Constructor and Description |
---|
ReplicationManager(short[] serverIds) |
Modifier and Type | Method and Description |
---|---|
void |
agentInitialize(boolean firstTime) |
protected void |
changeOwner(ChangeOwnerRequest request) |
private void |
createRemoteSubcontext(CreateRemoteSubcontextRequest request) |
protected void |
createSubcontext(CreateSubcontextRequest request) |
(package private) void |
doReact(AgentId from,
InitJndiServerNot not) |
(package private) void |
doReact(AgentId from,
JndiReplyNot not) |
(package private) void |
doReact(AgentId from,
JndiScriptReplyNot not) |
(package private) void |
doReact(AgentId from,
JndiUpdateNot not)
Reacts to an update notification from an other JNDI server.
|
(package private) void |
doReact(AgentId from,
SyncReplyNot not) |
(package private) void |
doReact(AgentId from,
SyncRequestNot not) |
protected AgentId |
getRootOwnerId()
Overrides the
JndiServer behavior. |
protected JndiReply |
invokeOwner(AgentId owner,
RequestContext reqCtx)
Overrides the
JndiServer behavior. |
protected JndiReply |
onMissingContext(MissingContextException mce,
RequestContext reqCtx)
In a centralized JNDI server a missing context shows
that the naming data are unconsistent.
|
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.
|
private void |
onReply(AgentId from,
JndiReply reply)
Reacts to the reply of a JNDI server that has been called
as it is the owner of a naming context.
|
void |
onUpdate(UpdateEvent event) |
private void |
onUpdateEvent(AgentId from,
BindEvent evt) |
private void |
onUpdateEvent(AgentId from,
ChangeOwnerEvent evt) |
private void |
onUpdateEvent(AgentId from,
CreateSubcontextEvent evt) |
private void |
onUpdateEvent(AgentId from,
DestroySubcontextEvent evt) |
private void |
onUpdateEvent(AgentId from,
RebindEvent evt) |
private void |
onUpdateEvent(AgentId from,
UnbindEvent evt) |
private void |
saveInitRequestTable() |
private void |
saveServers() |
private void |
saveSyncRequestTable() |
private void |
saveWriteRequestTable() |
private void |
synchronizeRequest(AgentId owner,
RequestContext reqCtx) |
agentFinalize, getId, getServerImpl, invoke, invokeAdminRequest, invokeReadRequest, invokeWriteRequest, sendTo, setContainer
private static final long serialVersionUID
public static final String INIT_REQUEST_TABLE
public static final String SYNC_REQUEST_TABLE
public static final String WRITE_REQUEST_TABLE
public static final String SERVER_LIST
private AgentId rootOwnerId
private short[] serverIds
private transient Vector servers
private transient Hashtable writeRequestContextLists
private transient Hashtable initRequestContextLists
private transient Hashtable syncRequestContextLists
private boolean looseCoupling
protected AgentId getRootOwnerId()
JndiServer
behavior.getRootOwnerId
in class RequestManager
public void agentInitialize(boolean firstTime) throws Exception
agentInitialize
in interface LifeCycleListener
agentInitialize
in class RequestManager
Exception
void doReact(AgentId from, JndiUpdateNot not) throws Exception
Exception
private void onUpdateEvent(AgentId from, BindEvent evt) throws NamingException
NamingException
private void onUpdateEvent(AgentId from, RebindEvent evt) throws NamingException
NamingException
private void onUpdateEvent(AgentId from, UnbindEvent evt) throws NamingException
NamingException
private void onUpdateEvent(AgentId from, CreateSubcontextEvent evt) throws NamingException
NamingException
private void onUpdateEvent(AgentId from, DestroySubcontextEvent evt) throws NamingException
NamingException
private void onUpdateEvent(AgentId from, ChangeOwnerEvent evt) throws NamingException
NamingException
protected JndiReply invokeOwner(AgentId owner, RequestContext reqCtx)
JndiServer
behavior.
Send a JNDI request to the owner (JNDI server).
Waits for the asynchronous reply.invokeOwner
in class RequestManager
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.null
if the owner invocation
is asynchronous.void doReact(AgentId from, JndiScriptReplyNot not) throws Exception
Exception
void doReact(AgentId from, JndiReplyNot not) throws Exception
Exception
private void onReply(AgentId from, JndiReply reply) throws Exception
Exception
void doReact(AgentId from, InitJndiServerNot not) throws Exception
Exception
protected JndiReply onMissingContext(MissingContextException mce, RequestContext reqCtx)
RequestManager
onMissingContext
in class RequestManager
mce
- the missing context exceptionreqCtx
- the JNDI request context that raised
the exception.null
if the resolution is asynchronous.protected JndiReply onMissingRecord(MissingRecordException mre, RequestContext reqCtx)
RequestManager
NameNotFoundException
is directly forwarded to
the client.
A subclass may override this behavior in order
to try to resolve the missing record.onMissingRecord
in class RequestManager
mre
- the missing context exceptionreqCtx
- the JNDI request context that raised
the exception.null
if the resolution is asynchronous.private void synchronizeRequest(AgentId owner, RequestContext reqCtx)
void doReact(AgentId from, SyncRequestNot not)
void doReact(AgentId from, SyncReplyNot not)
public void onUpdate(UpdateEvent event)
onUpdate
in interface UpdateListener
protected void createSubcontext(CreateSubcontextRequest request) throws NamingException
createSubcontext
in class RequestManager
NamingException
private void createRemoteSubcontext(CreateRemoteSubcontextRequest request) throws NamingException
NamingException
protected void changeOwner(ChangeOwnerRequest request) throws NamingException
changeOwner
in class RequestManager
NamingException
private void saveInitRequestTable()
private void saveWriteRequestTable()
private void saveSyncRequestTable()
private void saveServers()
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.