/** * Return a reference of the desired Component * @param component the component */ public void put( final Object component ) { if ( !m_prepared ) { final String message = "You cannot put a component in an uninitialized holder"; throw new IllegalStateException( message ); } if ( m_release.isActive() ) { m_release.increment(); } doPut( component ); }
/** * Get a reference of the desired Component * @return the component */ public Object get() throws Exception { if ( !m_prepared ) { prepareHandler(); } if ( m_disposed ) { final String message = "You cannot get a component from a disposed holder"; throw new IllegalStateException( message ); } if ( m_request.isActive() ) { m_request.increment(); } return doGet(); }
/** * Disposal of the supplied component instance. * @param component the component to dispose of * @exception Exception if a disposal error occurs */ public final void dispose( final Object component ) throws Exception { if ( getLogger().isDebugEnabled() ) { final String message = "ComponentFactory decommissioning instance of " + getCreatedClass().getName() + "."; getLogger().debug( message ); } if ( getCreatedClass().equals( component.getClass() ) ) { ContainerUtil.shutdown( component ); m_extManager.executeDestructionExtensions( component, m_context ); if ( m_dispose.isActive() ) { m_dispose.increment(); } } else { final String message = "The object given to be disposed does " + "not come from this ObjectFactory"; throw new IllegalArgumentException( message ); } }
if ( m_newInstance.isActive() )