public String lookup(String name) throws NamingException { Record rec = getRecord(name); if (rec != null) return rec.toString(); return null; }
public String lookup(String name) throws NamingException { Record rec = getRecord(name); if (rec != null) return rec.toString(); return null; }
public Properties getProperties(String name) throws NamingException { Properties prop = new Properties(); Record rec = getRecord(name); if(rec instanceof ObjectRecord) { Reference ref = (Reference) ((ObjectRecord) rec).getObject(); String className = ref.getClassName(); prop.setProperty("className", className); if(className.equals("org.objectweb.joram.client.jms.Topic") || className.equals("org.objectweb.joram.client.jms.Queue")) { prop.setProperty("agentId", (String) ref.get("dest.agentId").getContent()); prop.setProperty("name", (String) ref.get("dest.adminName").getContent()); } else if(className.equals("org.objectweb.joram.client.jms.tcp.QueueTcpConnectionFactory") ||className.equals("org.objectweb.joram.client.jms.tcp.TopicTcpConnectionFactory") || className.equals("org.objectweb.joram.client.jms.tcp.TcpConnectionFactory")) { prop.setProperty("host", (String) ref.get("cf.host").getContent()); prop.setProperty("port", (String) ref.get("cf.port").getContent()); } } return prop; }
public boolean unbind(NamingContext nc, String lastName, Object ownerId) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.unbind(" + nc + ',' + lastName + ',' + ownerId + ')'); if (! nc.getOwnerId().equals(ownerId) && (!looseCoupling) ) { throw new NotOwnerException( nc.getOwnerId()); } Record r = nc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) throw new NamingException("Cannot unbind a context"); nc.removeRecord(lastName); contextManager.storeNamingContext(nc); return true; } // else do nothing (idempotency) return false; }
public boolean unbind(NamingContext nc, String lastName, Object ownerId) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.unbind(" + nc + ',' + lastName + ',' + ownerId + ')'); if (! nc.getOwnerId().equals(ownerId) && (!looseCoupling) ) { throw new NotOwnerException( nc.getOwnerId()); } Record r = nc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) throw new NamingException("Cannot unbind a context"); nc.removeRecord(lastName); contextManager.storeNamingContext(nc); return true; } // else do nothing (idempotency) return false; }
public void bind(NamingContext nc, String lastName, Object obj, Object ownerId) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.bind(" + nc + ',' + lastName + ',' + obj + ',' + ownerId + ')'); if (! nc.getOwnerId().equals(ownerId) && (!looseCoupling) ) { throw new NotOwnerException( nc.getOwnerId()); } Record r = nc.getRecord(lastName); if (r != null) throw new NameAlreadyBoundException(); nc.addRecord(new ObjectRecord(lastName, obj)); contextManager.storeNamingContext(nc); }
public void bind(NamingContext nc, String lastName, Object obj, Object ownerId) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.bind(" + nc + ',' + lastName + ',' + obj + ',' + ownerId + ')'); if (! nc.getOwnerId().equals(ownerId) && (!looseCoupling) ) { throw new NotOwnerException( nc.getOwnerId()); } Record r = nc.getRecord(lastName); if (r != null) throw new NameAlreadyBoundException(); nc.addRecord(new ObjectRecord(lastName, obj)); contextManager.storeNamingContext(nc); }
while (enumRecord.hasMoreElements()) { Record record =(Record) enumRecord.nextElement(); Record r = nc.getRecord(record.getName()); if (r == null) nc.addRecord(record);
Record r = nc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) {
while (enumRecord.hasMoreElements()) { Record record =(Record) enumRecord.nextElement(); Record r = nc.getRecord(record.getName()); if (r == null) nc.addRecord(record);
Record r = nc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) {
Record r = parentNc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) {
Record r = parentNc.getRecord(lastName); if (r != null) { if (r instanceof ContextRecord) {
if (parentNc.getRecord(lastName) != null) throw new NameAlreadyBoundException(); NamingContext nc;
if (parentNc.getRecord(lastName) != null) throw new NameAlreadyBoundException(); NamingContext nc;
NamingContext nc = contextManager.getNamingContext(path); Record r = nc.getRecord(lastName); if (r == null) { NameNotFoundException nnfe =
NamingContext nc = contextManager.getNamingContext(path); Record r = nc.getRecord(lastName); if (r == null) { NameNotFoundException nnfe =
Record record = parentNc.getRecord(unresolvedName); if (record == null) { NameNotFoundException nnfe =
Record record = parentNc.getRecord(unresolvedName); if (record == null) { NameNotFoundException nnfe =