public String dump() { return AggregateLifeCycle.dump(this); } }
public void dump(Appendable out, String indent) throws IOException { AggregateLifeCycle.dumpObject(out,this); AggregateLifeCycle.dump(out, indent, _beans.entrySet()); }
/** Get dependent beans * @return List of beans. */ public Collection<Object> getBeans() { return getBeans(Object.class); }
@Override protected void doStop() throws Exception { closeConnections(); super.doStop(); }
@Override protected void doStart() throws Exception { LOG.debug("starting {}",this); super.doStart(); }
public void dump(Appendable out,String indent) throws IOException { dumpThis(out); int size=_beans.size(); if (size==0) return; int i=0; for (Bean b : _beans) { i++; out.append(indent).append(" +- "); if (b._managed) { if (b._bean instanceof Dumpable) ((Dumpable)b._bean).dump(out,indent+(i==size?" ":" | ")); else dumpObject(out,b._bean); } else dumpObject(out,b._bean); } if (i!=size) out.append(indent).append(" |\n"); }
public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); super.destroy(); if (_server!=null) _server.getContainer().removeBean(this); }
protected void dumpThis(Appendable out) throws IOException { out.append(String.valueOf(this)).append(" - ").append(getState()).append("\n"); }
/** * Add an associated bean. * If the bean is a {@link LifeCycle}, then it will be managed if it is not * already started and umanaged if it is already started. The {@link #addBean(Object, boolean)} * method should be used if this is not correct, or the {@link #manage(Object)} and {@link #unmanage(Object)} * methods may be used after an add to change the status. * @param o the bean object to add * @return true if the bean was added or false if it has already been added. */ public boolean addBean(Object o) { // beans are joined unless they are started lifecycles return addBean(o,!((o instanceof LifeCycle)&&((LifeCycle)o).isStarted())); }
public static void dump(Appendable out,String indent,Collection<?>... collections) throws IOException { if (collections.length==0) return; int size=0; for (Collection<?> c : collections) size+=c.size(); if (size==0) return; int i=0; for (Collection<?> c : collections) { for (Object o : c) { i++; out.append(indent).append(" +- "); if (o instanceof Dumpable) ((Dumpable)o).dump(out,indent+(i==size?" ":" | ")); else dumpObject(out,o); } if (i!=size) out.append(indent).append(" |\n"); } } }
if (contains(o)) return false;
@Override protected void doStop() throws Exception { LOG.debug("stopping {}",this); super.doStop(); }
@Override protected void doStart() throws Exception { LOG.debug("starting {}",this); super.doStart(); }
public void dump(Appendable out,String indent) throws IOException { dumpThis(out); int size=_beans.size(); if (size==0) return; int i=0; for (Bean b : _beans) { i++; out.append(indent).append(" +- "); if (b._managed) { if (b._bean instanceof Dumpable) ((Dumpable)b._bean).dump(out,indent+(i==size?" ":" | ")); else dumpObject(out,b._bean); } else dumpObject(out,b._bean); } if (i!=size) out.append(indent).append(" |\n"); }
public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); super.destroy(); if (_server!=null) _server.getContainer().removeBean(this); }
protected void dumpThis(Appendable out) throws IOException { out.append(String.valueOf(this)).append(" - ").append(getState()).append("\n"); }
/** * Add an associated bean. * If the bean is a {@link LifeCycle}, then it will be managed if it is not * already started and umanaged if it is already started. The {@link #addBean(Object, boolean)} * method should be used if this is not correct, or the {@link #manage(Object)} and {@link #unmanage(Object)} * methods may be used after an add to change the status. * @param o the bean object to add * @return true if the bean was added or false if it has already been added. */ public boolean addBean(Object o) { // beans are joined unless they are started lifecycles return addBean(o,!((o instanceof LifeCycle)&&((LifeCycle)o).isStarted())); }
public static void dump(Appendable out,String indent,Collection<?>... collections) throws IOException { if (collections.length==0) return; int size=0; for (Collection<?> c : collections) size+=c.size(); if (size==0) return; int i=0; for (Collection<?> c : collections) { for (Object o : c) { i++; out.append(indent).append(" +- "); if (o instanceof Dumpable) ((Dumpable)o).dump(out,indent+(i==size?" ":" | ")); else dumpObject(out,o); } if (i!=size) out.append(indent).append(" |\n"); } } }
if (contains(o)) return false;
public String dump() { return AggregateLifeCycle.dump(this); } }