public void addInstance(Object instance)
            throws Exception
    {
        State currentState = state.get();
        if ((currentState == State.STOPPING) || (currentState == State.STOPPED)) {
            throw new IllegalStateException();
        }
        else {
            startInstance(instance);
            if (methodsMap.get(instance.getClass()).hasFor(PreDestroy.class)) {
                managedInstances.add(instance);
            }
        }
    }
public void addInstance(Object instance)
            throws Exception
    {
        State currentState = state.get();
        if ((currentState == State.STOPPING) || (currentState == State.STOPPED)) {
            throw new IllegalStateException();
        }
        else {
            startInstance(instance);
            if (methodsMap.get(instance.getClass()).hasFor(PreDestroy.class)) {
                managedInstances.add(instance);
            }
        }
    }
public void addInstance ( Object instance ) throws Exception { State currentState = state . get ( ) ; if ( ( currentState == State . STOPPING ) || ( currentState == State . STOPPED ) ) { throw new IllegalStateException ( ) ; } else { startInstance ( instance ) ; if ( methodsMap . get ( instance . getClass ( ) ) . hasFor ( PreDestroy . class ) ) { managedInstances . add ( instance ) ; } } }
Add an additional managed instance

@param instance instance to add
@throws Exception errors
Add an additional managed instance