ObjectName parent = _beans.get(relationship.getParent()); if (parent == null) addBean(relationship.getParent()); parent = _beans.get(relationship.getParent()); ObjectName child = _beans.get(relationship.getChild()); if (child == null) addBean(relationship.getChild()); child = _beans.get(relationship.getChild());
/** * Implementation of Container.Listener interface * * @see org.eclipse.jetty.util.component.Container.Listener#remove(org.eclipse.jetty.util.component.Container.Relationship) */ public synchronized void remove(Relationship relationship) { LOG.debug("remove {}",relationship); ObjectName parent = _beans.get(relationship.getParent()); ObjectName child = _beans.get(relationship.getChild()); if (parent != null && child != null) { List<Container.Relationship> rels = _relations.get(parent); if (rels!=null) { for (Iterator<Container.Relationship> i=rels.iterator();i.hasNext();) { Container.Relationship r = i.next(); if (relationship.equals(r) || r.getChild()==null) i.remove(); } } } }
relation.getContainer().update(relation.getParent(), relation.getChild(), null, relation.getRelationship(), true);
/** 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); } }
/** 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); } }
/** 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); } }
@Override public void remove(Container.Relationship relationship) { removeBean(relationship.getChild()); }
@Override public void add(Container.Relationship relationship) { addBean(relationship.getChild()); }