public void agentInitialize(boolean firstTime) throws Exception { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "\n\nRequestManager.agentInitialize(" + firstTime + ')'); // Create the object that handles the // naming data. impl = new ServerImpl( AgentServer.getTransaction(), getId(), getRootOwnerId()); impl.initialize(); }
public void createSubcontext(CompositeName path) throws NamingException { createSubcontext(path, serverId); }
public void readBag(ObjectInputStream in) throws IOException, ClassNotFoundException { impl = new ServerImpl( AgentServer.getTransaction(), getId(), getRootOwnerId()); impl.readBag(in); } }
private void onUpdateEvent(AgentId from, UnbindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().unbind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().unbind( nc, evt.getName(), from); } }
servers.copyInto(localJndiServerIds); NamingContextInfo[] localContexts = getServerImpl().copyNamingContexts(getId()); int serversInitialLength = servers.size(); for (int i = 0; i < initServers.size(); i++) { for (int i = 0; i < contexts.length; i++) { if(!looseCoupling) { NamingContext nc = getServerImpl().getNamingContext( contexts[i].getNamingContext().getId()); if (nc == null) { getServerImpl().addNamingContext(contexts[i]); newNames.addElement(contexts[i].getCompositeName()); NamingContext nc; try{ nc = getServerImpl().getNamingContext(contexts[i].getCompositeName()); }catch(MissingRecordException mre){ nc=null; nc = getServerImpl().newNamingContext( getId(),null,contexts[i].getCompositeName()); contexts[i].getNamingContext().setOwnerId(getId()); while(enumContext.hasMoreElements()) { NamingContext nc =(NamingContext)enumContext.nextElement(); getServerImpl().storeNamingContext(nc);
private void onUpdateEvent(AgentId from, ChangeOwnerEvent evt) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ReplicationManager.onUpdateEvent(" + from + ',' + evt + ')'); NamingContextInfo[] contexts = evt.getNamingContexts(); for (int i = 0; i < contexts.length; i++) { NamingContext nc = getServerImpl().getNamingContext( contexts[i].getNamingContext().getId()); if (nc == null) { // The InitJndiServerNot sent by // the server that created this context may not // have been received. getServerImpl().addNamingContext(contexts[i]); // TODO : NTA uncomment and implement retryRequestsWaitingForMissingContext // retryRequestsWaitingForMissingContext( // contexts[i].getNamingContext().getId()); } else { nc.setOwnerId(contexts[i].getNamingContext().getOwnerId()); getServerImpl().resetNamingContext( contexts[i].getNamingContext()); // DF: must retry the sync and write // requests to the new owner. } } }
private void onUpdateEvent(AgentId from, BindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().bind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getObject(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().bind( nc, evt.getName(), evt.getObject(), from); } }
private void onUpdateEvent(AgentId from, RebindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().rebind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getObject(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().rebind( nc, evt.getName(), evt.getObject(), from); } }
private void onUpdateEvent(AgentId from, DestroySubcontextEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().destroySubcontext( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getPath(), from); }else{ CompositeName parentPath = (CompositeName) evt.getPath().clone(); parentPath.remove(parentPath.size() - 1); NamingContext nc= getServerImpl().getNamingContext(parentPath); getServerImpl().destroySubcontext( nc, evt.getName(), evt.getPath(), from); } }
private void onUpdateEvent(AgentId from, CreateSubcontextEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().createSubcontext( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getPath(), evt.getContextId(), evt.getOwnerId(), from); }else{ CompositeName parentPath = (CompositeName) evt.getPath().clone(); parentPath.remove(parentPath.size() - 1); NamingContext nc= getServerImpl().getNamingContext(parentPath); getServerImpl().createSubcontext(nc, evt.getName(), evt.getPath(), evt.getContextId(), getId(), from); } }
private void destroySubcontext(DestroySubcontextRequest request) throws NamingException { impl.destroySubcontext( request.getName()); }
private NameClassPair[] list(ListRequest request) throws NamingException { return impl.list(request.getName()); }
protected void changeOwner(ChangeOwnerRequest request) throws NamingException { AgentId newOwnerId; try { newOwnerId = AgentId.fromString(request.getOwnerId()); } catch (Exception exc) { NamingException ne = new NamingException(exc.toString()); ne.setRootCause(exc); throw ne; } if (getId().equals(newOwnerId)) throw new NamingException("Server already owner"); impl.changeOwner(request.getName(), newOwnerId); }
NamingContext nc = contextManager.getNamingContext(path); bind(nc, lastName, obj, serverId);
servers.copyInto(localJndiServerIds); NamingContextInfo[] localContexts = getServerImpl().copyNamingContexts(getId()); int serversInitialLength = servers.size(); for (int i = 0; i < initServers.size(); i++) { if(!looseCoupling) { NamingContext nc = getServerImpl().getNamingContext( contexts[i].getNamingContext().getId()); if (nc == null) { getServerImpl().addNamingContext(contexts[i]); newNames.addElement(contexts[i].getCompositeName()); NamingContext nc; try{ nc = getServerImpl().getNamingContext(contexts[i].getCompositeName()); }catch(MissingRecordException mre){ nc=null; nc = getServerImpl().newNamingContext( getId(),null,contexts[i].getCompositeName()); contexts[i].getNamingContext().setOwnerId(getId()); while(enumContext.hasMoreElements()) { NamingContext nc =(NamingContext)enumContext.nextElement(); getServerImpl().storeNamingContext(nc);
private void onUpdateEvent(AgentId from, ChangeOwnerEvent evt) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ReplicationManager.onUpdateEvent(" + from + ',' + evt + ')'); NamingContextInfo[] contexts = evt.getNamingContexts(); for (int i = 0; i < contexts.length; i++) { NamingContext nc = getServerImpl().getNamingContext( contexts[i].getNamingContext().getId()); if (nc == null) { // The InitJndiServerNot sent by // the server that created this context may not // have been received. getServerImpl().addNamingContext(contexts[i]); // TODO : NTA uncomment and implement retryRequestsWaitingForMissingContext // retryRequestsWaitingForMissingContext( // contexts[i].getNamingContext().getId()); } else { nc.setOwnerId(contexts[i].getNamingContext().getOwnerId()); getServerImpl().resetNamingContext( contexts[i].getNamingContext()); // DF: must retry the sync and write // requests to the new owner. } } }
private void onUpdateEvent(AgentId from, UnbindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().unbind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().unbind( nc, evt.getName(), from); } }
private void onUpdateEvent(AgentId from, BindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().bind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getObject(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().bind( nc, evt.getName(), evt.getObject(), from); } }
private void onUpdateEvent(AgentId from, RebindEvent evt) throws NamingException { if(!looseCoupling){ getServerImpl().rebind( getServerImpl().getNamingContext( evt.getUpdatedContextId()), evt.getName(), evt.getObject(), from); }else{ NamingContext nc= getServerImpl().getNamingContext(evt.getPath()); getServerImpl().rebind( nc, evt.getName(), evt.getObject(), from); } }