/** * Repository's classloader * @return {@linkplain ClassLoader} used to load extensions from the repository */ final synchronized public ClassLoader getClassLoader() { if (cLoader == null) { cLoader = getClassLoader(pLoader); } return cLoader; }
/** * Repository's classloader * @return {@linkplain ClassLoader} used to load extensions from the repository */ final synchronized public ClassLoader getClassLoader() { if (cLoader == null) { cLoader = getClassLoader(pLoader); } return cLoader; }
/** * Loads an extension by name * @param className The extension class name * @return The class of a loaded extension or <b>NULL</b> */ final public Class loadExtension(String className) { try { return getClassLoader().loadClass(className.replace('/', '.')); } catch (ClassNotFoundException ex) { } return null; } /**
/** * Loads an extension by name * @param className The extension class name * @return The class of a loaded extension or <b>NULL</b> */ final public Class loadExtension(String className) { try { return getClassLoader().loadClass(className.replace('/', '.')); } catch (ClassNotFoundException ex) { } return null; } /**
private Iterable<MBeanDecoratorImpl> listDecorators() { final ServiceLoader<MBeanDecoratorImpl> decoratorLoader = ServiceLoader.load(MBeanDecoratorImpl.class, repository.getClassLoader(BTraceMBeanImpl.class.getClassLoader())); return new IterableServiceLoader<MBeanDecoratorImpl>(decoratorLoader); }
/** * Lists all the extensions known to the repository * @return A FQN list of all extensions in the repository */ final public Collection<String> listExtensions() { if (extensionsLoaded.compareAndSet(false, true)) { for(String svcName : ServiceLocator.listServiceNames(BTraceExtension.class, getClassLoader())) { enabledExtensions.add(svcName); } } return Collections.unmodifiableSet(enabledExtensions); }
/** * Lists all the extensions known to the repository * @return A FQN list of all extensions in the repository */ final public Collection<String> listExtensions() { if (extensionsLoaded.compareAndSet(false, true)) { for(String svcName : ServiceLocator.listServiceNames(BTraceExtension.class, getClassLoader())) { enabledExtensions.add(svcName); } } return Collections.unmodifiableSet(enabledExtensions); }
private Iterable<MBeanDecoratorImpl> listDecorators() { final ServiceLoader<MBeanDecoratorImpl> decoratorLoader = ServiceLoader.load(MBeanDecoratorImpl.class, repository.getClassLoader(BTraceMBeanImpl.class.getClassLoader())); return new IterableServiceLoader<MBeanDecoratorImpl>(decoratorLoader); }
protected CommandFactory newCommandFactory() { return CommandFactory.getInstance(extRep.getClassLoader(getMyLoader()), Command.Target.CLIENT); } }
public Server(BlockingQueue<AbstractCommand> in, BlockingQueue<AbstractCommand> out, ExtensionsRepository extRep) { super(in, out); cFactory = CommandFactory.getInstance(extRep.getClassLoader(getMyLoader()), Command.Target.SERVER); init(); }
public Client(BlockingQueue<AbstractCommand> in, BlockingQueue<AbstractCommand> out, ExtensionsRepository extRep) { super(in, out); cFactory = CommandFactory.getInstance(extRep.getClassLoader(getMyLoader()), Command.Target.SERVER); init(); }
public Client(BlockingQueue<AbstractCommand> in, BlockingQueue<AbstractCommand> out, ExtensionsRepository extRep) { super(in, out); cFactory = CommandFactory.getInstance(extRep.getClassLoader(getMyLoader()), Command.Target.SERVER); init(); }
public Server(BlockingQueue<AbstractCommand> in, BlockingQueue<AbstractCommand> out, ExtensionsRepository extRep) { super(in, out); cFactory = CommandFactory.getInstance(extRep.getClassLoader(getMyLoader()), Command.Target.SERVER); init(); }
public static Channel open(Socket skt, final ExtensionsRepository extRep) { try { ObjectInputStream ois = new ObjectInputStreamEx(skt.getInputStream(), extRep.getClassLoader()); ObjectOutput oos = new ObjectOutputStream(skt.getOutputStream()); ServerChannel ch = new ServerChannel(ois, oos, extRep); if (!ch.handshake()) { try { ch.output.close(); ch.input.close(); } catch (IOException e) { } return null; } return ch; } catch (IOException e) { } return null; }
public static Channel open(Socket skt, final ExtensionsRepository extRep) { try { ObjectInputStream ois = new ObjectInputStreamEx(skt.getInputStream(), extRep.getClassLoader()); ObjectOutput oos = new ObjectOutputStream(skt.getOutputStream()); ServerChannel ch = new ServerChannel(ois, oos, extRep); if (!ch.handshake()) { try { ch.output.close(); ch.input.close(); } catch (IOException e) { } return null; } return ch; } catch (IOException e) { } return null; }
public static Channel open(Socket skt, ExtensionsRepository extRep) { try { ObjectOutput oos = new ObjectOutputStream(skt.getOutputStream()); ObjectInputStream ois = new ObjectInputStreamEx(skt.getInputStream(), extRep.getClassLoader()); ClientChannel ch = new ClientChannel(ois, oos, extRep); if (!ch.handshake()) { try { ch.output.close(); ch.input.close(); } catch (IOException e) { } return null; } return ch; } catch (IOException e) { } return null; }
public static Channel open(Socket skt, ExtensionsRepository extRep) { try { ObjectOutput oos = new ObjectOutputStream(skt.getOutputStream()); ObjectInputStream ois = new ObjectInputStreamEx(skt.getInputStream(), extRep.getClassLoader()); ClientChannel ch = new ClientChannel(ois, oos, extRep); if (!ch.handshake()) { try { ch.output.close(); ch.input.close(); } catch (IOException e) { } return null; } return ch; } catch (IOException e) { } return null; }
public Client setExtRepository(ExtensionsRepository extRepository) { if (state.get() != State.OFFLINE) { BTraceLogger.debugPrint("Can not change client parameters when already attached"); return this; } if (extRepository != this.extRepository) { this.extRepository = extRepository != null ? extRepository : DEFAULT_REPOSITORY; if (vFormatter != null) { commandCtx.remove(vFormatter); } vFormatter = new ValueFormatter(extRepository.getClassLoader()); commandCtx.add(vFormatter); } return this; }
public Client setExtRepository(ExtensionsRepository extRepository) { if (state.get() != State.OFFLINE) { BTraceLogger.debugPrint("Can not change client parameters when already attached"); return this; } if (extRepository != this.extRepository) { this.extRepository = extRepository != null ? extRepository : DEFAULT_REPOSITORY; if (vFormatter != null) { commandCtx.remove(vFormatter); } vFormatter = new ValueFormatter(extRepository.getClassLoader()); commandCtx.add(vFormatter); } return this; }
mapper[i] = cmdClz; CommandFactory cf = CommandFactory.getInstance(mapper, extRep.getClassLoader(getMyLoader()), Command.Target.SERVER); List<Class<? extends AbstractCommand>> cmds = cf.listSupportedCommands(); output.writeInt(cmds.size() - commandCnt);