/** * @param name configuration name * @param timeout in millis * @return Configuration object or null */ public static Configuration getConfiguration (String name, long timeout) { return (Configuration) NameRegistrar.get(PREFIX + name, timeout); } }
/** * @return MUX with name using NameRegistrar * @throws NameRegistrar.NotFoundException * @see NameRegistrar */ public static MUX getMUX (String name) throws NameRegistrar.NotFoundException { return (MUX) NameRegistrar.get ("mux."+name); }
/** * @return ISOMUX instance with given name. * @throws NameRegistrar.NotFoundException; * @see NameRegistrar */ public static ISOMUX getMUX (String name) throws NameRegistrar.NotFoundException { return (ISOMUX) NameRegistrar.get ("mux."+name); } /**
/** * @param name configuration name * @param timeout in millis * @return Configuration Element or null */ public static Element getConfiguration (String name, long timeout) { return (Element) NameRegistrar.get(XML_PREFIX + name, timeout); } }
/** * @return ISOServer instance with given name. * @throws NameRegistrar.NotFoundException; * @see NameRegistrar */ public static ISOServer getServer (String name) throws NameRegistrar.NotFoundException { return (ISOServer) NameRegistrar.get ("server."+name); } /**
/** * @param name * @return SMAdapter instance with given name. * @throws NotFoundException * @see NameRegistrar */ public static SMAdapter getSMAdapter (String name) throws NameRegistrar.NotFoundException { return (SMAdapter)NameRegistrar.get("s-m-adapter." + name); }
/** * @return MUX instance with given name. * @throws NameRegistrar.NotFoundException; * @see NameRegistrar */ public static MUX getMUX (String name) throws NameRegistrar.NotFoundException { return (MUX) NameRegistrar.get ("mux."+name); } public boolean isConnected () {
/** * @return ISOMUX instance with given name. * @throws NameRegistrar.NotFoundException; * @see NameRegistrar */ public static ConnectionPool getConnectionPool (String name) throws NameRegistrar.NotFoundException { return (ConnectionPool) NameRegistrar.get ("connection.pool."+name); }
/** * @param name the Channel's name (without the "channel." prefix) * @return ISOChannel instance with given name. * @throws NameRegistrar.NotFoundException; * @see NameRegistrar */ public static ISOChannel getChannel (String name) throws NameRegistrar.NotFoundException { return (ISOChannel) NameRegistrar.get ("channel."+name); } /**
public static Element getConfiguration (String name) throws NameRegistrar.NotFoundException { return (Element) NameRegistrar.get(XML_PREFIX + name); }
public static Configuration getConfiguration (String name) throws NameRegistrar.NotFoundException { return (Configuration) NameRegistrar.get(PREFIX + name); }
/** * Retrieves a thread pool from NameRegistrar given its name, unique identifier. * * @param name Name of the thread pool to retrieve, must be the same as the name property of the thread-pool tag in the QSP config file * @throws NotFoundException thrown when there is not a thread-pool registered under this name. * @return returns the retrieved instance of thread pool */ public static ThreadPool getThreadPool(java.lang.String name) throws NotFoundException { return (ThreadPool)NameRegistrar.get("thread.pool." + name); } }
public void addChannel (String name) throws NameRegistrar.NotFoundException { pool.add (NameRegistrar.get ("channel."+name)); } public void removeChannel (ISOChannel channel) {
public JComponent create(UI ui, Element e) { try { TransactionManager tm = (TransactionManager) NameRegistrar.get (e.getAttributeValue ("transaction-manager")); return new TMMonitor (ui, tm); } catch (NameRegistrar.NotFoundException ex) { return new JTextArea (ex.toString()); } } }
protected void startService () throws RemoteException, NamingException, NotFoundException { qmux = (QMUX) NameRegistrar.get(qmuxName); qmuxproxy = new QMUXProxy(qmux); InitialContext ctx = new InitialContext (); ctx.rebind (getName (), qmuxproxy); }
private void showOne(CLIContext cli, String name, boolean detail) { try { Object obj = NameRegistrar.get(name); cli.println(name + " : " + obj.toString()); if (detail && obj instanceof Loggeable) { cli.printLoggeable((Loggeable) obj, ""); } } catch (NameRegistrar.NotFoundException e) { cli.println("Object not found in NameRegistrar"); } }
@Test public void testGet() throws Exception { String value = NameRegistrar.get("test1"); assertThat(value, is("testValue1")); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { mux = (SpaceMUX) NameRegistrar.get (cfg.get ("mux")); } catch (NotFoundException e) { throw new ConfigurationException (e); } timeout = cfg.getLong ("timeout", 120000); pool = new ThreadPool (1, cfg.getInt ("pool", 100)); }
@Test public void testStaticGetThreadPoolExecutor() throws NotFoundException { executor = new DummyThreadPoolExecutor(1, 1, 1, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1) ); NameRegistrar.register(qbean.getRegistrationName(), executor); ThreadPoolExecutor expected = NameRegistrar.get(qbean.getRegistrationName()); assertSame(expected, executor); expected = QThreadPoolExecutor.getThreadPoolExecutor(QBEAN_DEFAULT_NAME); assertSame(expected, executor); }