result.setProperty(key, rb.getString(key)); if (TraceCarol.isDebugCarol()) { TraceCarol.debugCarol("Carol file used is " + fName + ".properties through URLClassLoader"); result = new Properties(); result.load(fInputStream); if (TraceCarol.isDebugCarol()) { TraceCarol.debugCarol( "Carol file used is " + fName
/** * Get a cluster stub (stub of all equivalent objects). * @return <code>null<code> if not exported. */ ClusterStub getGlobal(Serializable key) throws RemoteException { if (TraceCarol.isDebugCmiDes()) TraceCarol.debugCmiDes("getGlobal(" + key + ")"); ClusterStub cs; cs = globalExports.getClusterStub(key); return cs; }
/** * Stop the registry. After the call, this object is useless. * @throws NoSuchObjectException if the registry has not been exported. */ public synchronized void stop() throws NoSuchObjectException { if (TraceCarol.isDebugCmiRegistry()) { TraceCarol.debugCmiRegistry("killer is stopping registry on port " + port); } LowerOrb.unexportObject(impl); impl = null; } }
/** * set port method, set the port for the name service * @param int port */ public void setPort(int p) { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("CmiRegistry.setPort(" + p + ")"); } if (p != 0) { this.port = p; } }
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); } }
/** * Private method for orb intanciation */ private void initProtocols() throws Exception { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.initProtocols()"); } pcur = ProtocolCurrent.getCurrent(); activesProtocols = pcur.getPortableRemoteObjectHashtable(); init = true; }
/** * Export a Remote Object on all available protocols * @param Remote object to export * @exception RemoteException exporting remote object problem */ public void exportObject(Remote obj) throws RemoteException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.exportObject(" +simpleClass(obj.getClass().getName()) +" obj)"); } try { if (!init) { initProtocols(); } for (Enumeration e = activesProtocols.elements(); e.hasMoreElements() ;) { ((PortableRemoteObjectDelegate)e.nextElement()).exportObject(obj); } if (TraceCarol.isDebugExportCarol()) { TraceCarol.debugExportCarol("Export object "+obj.getClass().getName()); addObject(obj.getClass().getName()); } } catch (Exception ex) { String msg = "MultiPRODelegate.exportObject(Remote obj) fail"; TraceCarol.error(msg,ex); throw new RemoteException(msg); } }
/** * Start all non-started names service * @throws NameServiceException if an exception occure at starting time */ public static void startNonStartedNS() throws NameServiceException { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("NameServiceManager.startNonStartedNS()"); } // start name services for (Enumeration e = nsTable.keys() ; e.hasMoreElements() ;) { String k = (String)e.nextElement(); NameService currentNS = (NameService)nsTable.get(k); try { currentNS.start(); if (TraceCarol.isInfoCarol()) { TraceCarol.infoCarol("Name service for "+k+" is started on port "+currentNS.getPort()); } } catch (NameServiceException nse) { // do nothing, just trace if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("NameServiceManager.startNonStartedNS() can not start name service: "+k); } } } }
/** * 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); }
public void run() { try { CmiRegistry.this.stop(); } catch (Exception e) { TraceCarol.error( "CmiRegistry ShutdownHook problem", e); } } });
/** * private constructor for unicicity */ private NameServiceManager() { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("NameServiceManager.NameServiceManager()"); } try { nsTable = new Hashtable(); //get rmi configuration hashtable Hashtable allRMIConfiguration = CarolConfiguration.getAllRMIConfiguration(); int nbProtocol = allRMIConfiguration.size(); for (Enumeration e = allRMIConfiguration.elements() ; e.hasMoreElements() ;) { RMIConfiguration currentConf = (RMIConfiguration)e.nextElement(); String rmiName = currentConf.getName(); NameService nsC = (NameService)Class.forName(currentConf.getNameService()).newInstance(); nsC.setPort(currentConf.getPort()); // get the Name Service nsTable.put(rmiName, nsC); } } catch (Exception e) { String msg = "NameServiceManager.NameServiceManager() fail"; TraceCarol.error(msg,e); } }
/** * get carol properties from file * @return Properties carol properties */ private static Properties getCarolProperties() throws Exception { Properties props = null; try { props = loadPropertiesFile("carol", Thread.currentThread().getContextClassLoader()); } catch (Exception e) { TraceCarol.debugCarol("carol.properties file not found: " + e); } return props; }
/** * start Method, Start a new NameService or do nothing if the name service is all ready start * @param int port is port number * @throws NameServiceException if a problem occure */ public void start() throws NameServiceException { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("LMIRegistry.start() on port:" + port); } // do nothing }
IOException { if (ctxValue==NO_CTX) { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("JClientInterceptorHelper getObjectFromInput no context"); if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("JClientInterceptorHelper getObjectFromInput remote"); if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("JClientInterceptorHelper getObjectFromInput local id("+id+")");
/** * Method for unexport object on all available protocols * @param Remote obj object to unexport * @exception NoSuchObjectException if the object is not currently exported */ public void unexportObject(Remote obj) throws NoSuchObjectException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.unexportObject(" +simpleClass(obj.getClass().getName()) +" obj)"); } try { if (!init) { initProtocols(); } for (Enumeration e = activesProtocols.elements(); e.hasMoreElements() ;) { ((PortableRemoteObjectDelegate)e.nextElement()).unexportObject(obj); } if (TraceCarol.isDebugExportCarol()) { TraceCarol.debugExportCarol("Unexport object "+obj.getClass().getName()); TraceCarol.debugExportCarol("UnExported objects list:\n"+getUnexportedObjects()); removeObject(obj.getClass().getName()); } } catch (Exception ex) { String msg = "MultiPRODelegate.unexportObject(Remote obj) fail"; TraceCarol.error(msg,ex); throw new NoSuchObjectException(msg); } }
/** * Connection method all available protocols * @param target a remote object; * @param source another remote object; * @exception RemoteException if the connection fail */ public void connect(Remote target,Remote source) throws RemoteException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.connect("+simpleClass(target.getClass().getName()) + " target," +simpleClass(source.getClass().getName()) +" source)"); } try { if (!init) { initProtocols(); } for (Enumeration e = activesProtocols.elements(); e.hasMoreElements() ;) { ((PortableRemoteObjectDelegate)e.nextElement()).connect(target, source); } } catch (Exception e) { String msg = "MultiPRODelegate.connect(Remote target,Remote source) fail"; TraceCarol.error(msg,e); throw new RemoteException(msg); } }
/** * 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); } }
/** * 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"); }
TraceCarol.debugCarol("map properties found in jndi.properties to CAROL ones"); Properties result = new Properties();
public String getNameInNamespace() throws NamingException { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("LmiInitialContext.getNameInNamespace()"); } return "lmiContext"; }