public void run() { try { NameServiceManager.stopNS(); } catch (Exception e) { TraceCarol.error("Carol Naming ShutdownHook problem" ,e); } } });
public void run() { try { CmiRegistry.this.stop(); } catch (Exception e) { TraceCarol.error( "CmiRegistry ShutdownHook problem", e); } } });
/** * Destroys the named context and removes it from the namespace. * Not supported yet. * @param name the name of the context to be destroyed; may not be empty * @throws NamingException if a naming exception is encountered */ public void destroySubcontext(String name) throws NamingException { TraceCarol.error("CompNamingContext try to destroySubcontext "+name); throw new OperationNotSupportedException("CompNamingContext: destroySubcontext"); }
public void run() { try { IIOPCosNaming.this.stop(); } catch (Exception e) { TraceCarol.error("IIOPCosNaming ShutdownHook problem" ,e); } } });
private String getRelativeName(String name) throws NamingException { // We suppose that all names must be prefixed as this if (!name.startsWith(URL_PREFIX)) { TraceCarol.error( "relative name!" + name); throw new NameNotFoundException("Invalid name:" + name); } name = name.substring(URL_PREFIX.length()); return name; }
public void run() { try { JeremieRegistry.this.stop(); } catch (Exception e) { TraceCarol.error("JeremieRegistry ShutdownHook problem" ,e); } } });
public void run() { try { JRMPRegistry.this.stop(); } catch (Exception e) { TraceCarol.error("JRMPRegistry ShutdownHook problem" ,e); } } });
public void destroySubcontext(String name) throws NamingException { TraceCarol.error("LmiInitialContext.destroySubcontext(\""+name+"\"): Not supported"); throw new OperationNotSupportedException("LmiInitialContext.destroySubcontext(\""+name+"\"): Not supported"); }
/** * Composes the name of this context with a name relative to * this context. * * @param name a name relative to this context * @param prefix the name of this context relative to one of its ancestors * @return the composition of prefix and name * @throws NamingException if a naming exception is encountered */ public Name composeName(Name name, Name prefix) throws NamingException { TraceCarol.error("CompNamingContext composeName not implemented!"); throw new OperationNotSupportedException("CompNamingContext composeName"); }
/** * Composes the name of this context with a name relative to * this context: Not supported. * * @param name a name relative to this context * @param prefix the name of this context relative to one of its ancestors * @return the composition of prefix and name * @throws NamingException if a naming exception is encountered */ public String composeName(String name, String prefix) throws NamingException { TraceCarol.error("CompNamingContext composeName "+name+" "+prefix); throw new OperationNotSupportedException("CompNamingContext composeName"); }
public Context createSubcontext(String name) throws NamingException { TraceCarol.error("LmiInitialContext.createSubcontext(\""+name+"\"): Not supported"); throw new OperationNotSupportedException("LmiInitialContext.createSubcontext(\""+name+"\"): Not supported"); }
/** * ORBInitializer pre_init method * here we add the iiop interceptor */ public void pre_init(ORBInitInfo info){ try { info.add_server_request_interceptor(new ProtocolInterceptor()); } catch (Exception e) { TraceCarol.error("ProtocolInitializer.pre_init(ORBInitInfo info) could'nt instantiate iiop Interceptor", e); } }
/** * In JRMP the 2 method( per and post init have the same * consequences ... * @param JInitInfo the JInit Information */ public void pre_init(JInitInfo info){ try { info.add_server_request_interceptor(new ProtocolInterceptor()); } catch (Exception e) { TraceCarol.error("ProtocolInterceptorInitializer.pre_init(JInitInfo info) could'nt instantiate iiop Interceptor", e); } }
public MultiPRODelegate() throws RemoteException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.MultiPRODelegate()"); } try { initProtocols(); } catch (Exception e) { String msg = "MultiPRODelegate, init protocols fail"; TraceCarol.error(msg,e); throw new RemoteException(msg); } }
/** * Retrieves the named object, following links except * for the terminal atomic component of the name. * If the object bound to name is not a link, * returns the object itself. * * @param name * the name of the object to look up * @return the object bound to name, not following the * terminal link (if any) * @throws NamingException if a naming exception is encountered */ public Object lookupLink(String name) throws NamingException { TraceCarol.debugJndiCarol("entering for "+name); // To be done. For now: just return the object TraceCarol.error("CompNamingContext lookupLink not implemented yet!"); return lookup(name); }
/** * Resolve a Remote Object: * If this object is a reference return the reference * * @param o the object to resolve * @param n the name of this object * @return a <code>Referenceable</code> if o is a Reference * and the inititial object o if else */ private Object resolveObject(Object o, Name name) { try { if (o instanceof Reference) { // build of the Referenceable object with is Reference Reference objRef = (Reference)o; ObjectFactory objFact = (ObjectFactory)(Thread.currentThread().getContextClassLoader().loadClass(objRef.getFactoryClassName())).newInstance(); return objFact.getObjectInstance(objRef,name,this,this.getEnvironment()); } else { return o; } } catch (Exception e) { TraceCarol.error("LmiInitialContext.resolveObject()", e); return o; } }
/** * Binds a new name to the object bound to an old name, and unbinds * the old name. * * @param oldName the name of the existing binding; may not be empty * @param newName the name of the new binding; may not be empty * @throws NamingException if a naming exception is encountered */ public void rename(String oldName, String newName) throws NamingException { TraceCarol.error("CompNamingContext rename "+oldName+" in "+newName); Object obj = lookup(oldName); rebind(newName, obj); unbind(oldName); }
/** * Enumerates the names bound in the named context, along with the * class names of objects bound to them. * * @param name the name of the context to list * @return an enumeration of the names and class names of the * bindings in this context. Each element of the * enumeration is of type NameClassPair. * @throws NamingException if a naming exception is encountered */ public NamingEnumeration list(String name) throws NamingException { TraceCarol.debugJndiCarol("entering for "+name); if (name.length() == 0) { // List this context return new ListOfNames(bindings); } Object obj = lookup(name); if (obj instanceof Context) { return ((Context) obj).list(""); } else { TraceCarol.error("CompNamingContext: can only list a Context"); throw new NotContextException(name); } }
/** * Narrow method on the default protocol * @param Remote obj the object to narrow * @param Class newClass the expected type of the result * @return an object of type newClass * @exception ClassCastException if the obj class is not compatible with a newClass cast */ public Object narrow(Object obj, Class newClass ) throws ClassCastException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.narrow("+simpleClass(obj.getClass().getName()) + " obj," +simpleClass(newClass.getName()) +" class)/rmi name=\""+ pcur.getCurrentRMIName()+"\""); } try { if (init) { return pcur.getCurrentPortableRemoteObject().narrow(obj, newClass); } else { initProtocols(); return pcur.getCurrentPortableRemoteObject().narrow(obj, newClass); } } catch (Exception e) { String msg = "MultiPRODelegate.narrow(Object obj, Class newClass) fail"; TraceCarol.error(msg,e); throw new ClassCastException (msg); } }
/** * To stub method on the iiop protocol * @return the stub object * @param Remote object to unexport * @exception NoSuchObjectException if the object is not currently exported */ public Remote toStub(Remote obj) throws NoSuchObjectException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.toStub(" +simpleClass(obj.getClass().getName()) +" obj)/rmi name=\"" +pcur.getCurrentRMIName()+"\""); } try { if (init) { return pcur.getCurrentPortableRemoteObject().toStub(obj); } else { initProtocols(); return pcur.getCurrentPortableRemoteObject().toStub(obj); } } catch (Exception e) { String msg = "MultiPRODelegate.toStub(Remote obj) fail"; TraceCarol.error(msg,e); throw new NoSuchObjectException(msg); } }