private void removeServerMBean() { try { mBeanContainer.beanRemoved(null, server); } catch (RuntimeException rex) { throw rex; } catch (Exception r) { throw new RuntimeException(r); } }
l.beanAdded(this,o);
l.beanAdded(this,o);
l.beanRemoved(this,bean._bean);
l.beanRemoved(this,bean._bean);
private boolean remove(Bean bean) { if (_beans.remove(bean)) { unmanage(bean); for (Container.Listener l:_listeners) l.beanRemoved(this,bean._bean); if (bean._bean instanceof Container.Listener) { Container.Listener listener = (Container.Listener)bean._bean; if (_listeners.remove(listener)) { // remove existing beans for (Bean b:_beans) { listener.beanRemoved(this,b._bean); if (listener instanceof InheritedListener && b.isManaged() && b._bean instanceof Container) ((Container)b._bean).removeBean(listener); } } } return true; } return false; }
private boolean remove(Bean bean) { if (_beans.remove(bean)) { unmanage(bean); for (Container.Listener l:_listeners) l.beanRemoved(this,bean._bean); if (bean._bean instanceof Container.Listener) { Container.Listener listener = (Container.Listener)bean._bean; if (_listeners.remove(listener)) { // remove existing beans for (Bean b:_beans) { listener.beanRemoved(this,b._bean); if (listener instanceof InheritedListener && b.isManaged() && b._bean instanceof Container) ((Container)b._bean).removeBean(listener); } } } return true; } return false; }
@Override public void addEventListener(Container.Listener listener) { if (_listeners.contains(listener)) return; _listeners.add(listener); // tell it about existing beans for (Bean b:_beans) { listener.beanAdded(this,b._bean); // handle inheritance if (listener instanceof InheritedListener && b.isManaged() && b._bean instanceof Container) { if (b._bean instanceof ContainerLifeCycle) ((ContainerLifeCycle)b._bean).addBean(listener, false); else ((Container)b._bean).addBean(listener); } } }
@Override public void addEventListener(Container.Listener listener) { if (_listeners.contains(listener)) return; _listeners.add(listener); // tell it about existing beans for (Bean b:_beans) { listener.beanAdded(this,b._bean); // handle inheritance if (listener instanceof InheritedListener && b.isManaged() && b._bean instanceof Container) { if (b._bean instanceof ContainerLifeCycle) ((ContainerLifeCycle)b._bean).addBean(listener, false); else ((Container)b._bean).addBean(listener); } } }
/** remove a parent child relationship * @param parent * @param child * @param relationship */ private void remove(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" - "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).remove(event); } }
/** remove a parent child relationship * @param parent * @param child * @param relationship */ private void remove(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" - "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).remove(event); } }
/** Add a parent child relationship * @param parent * @param child * @param relationship */ private void add(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" + "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).add(event); } }
/** remove a parent child relationship * @param parent * @param child * @param relationship */ private void remove(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" - "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).remove(event); } }
/** Add a parent child relationship * @param parent * @param child * @param relationship */ private void add(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" + "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).add(event); } }
/** Add a parent child relationship * @param parent * @param child * @param relationship */ private void add(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" + "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).add(event); } }
/** Add a parent child relationship * @param parent * @param child * @param relationship */ private void add(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" + "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).add(event); } }
/** remove a parent child relationship * @param parent * @param child * @param relationship */ private void remove(Object parent, Object child, String relationship) { if (LOG.isDebugEnabled()) LOG.debug("Container "+parent+" - "+child+" as "+relationship); if (_listeners!=null) { Relationship event=new Relationship(this,parent,child,relationship); for (int i=0; i<LazyList.size(_listeners); i++) ((Listener)LazyList.get(_listeners, i)).remove(event); } }