/** This callback is set by the container so that the plugin may access it * * @param con The container using this plugin. */ public void setContainer (Container con) { this.container = con; if (con != null) this.ejbModule = con.getEjbModule (); else this.ejbModule = null; }
/** * Sets the container for this entity. * @param container the container for this entity * @throws ClassCastException if the container is not an instance of * EntityContainer */ public void setContainer(Container container) { this.container = (EntityContainer)container; if(container != null) { ejbModule = container.getEjbModule(); log = Logger.getLogger( this.getClass().getName() + "." + container.getBeanMetaData().getEjbName()); } else { ejbModule = null; } }
/** * Stores the container reference and the application and bean JNDI * names. * * @param container set by the container initialization code */ public void setContainer(Container container) { super.setContainer(container); if (container != null) { applicationName = container.getEjbModule().getName(); beanName = container.getBeanMetaData().getJndiName(); } }
public void create() throws Exception { super.create (); this.allowInvocations = false; this.allowRemoteInvocations = false; this.isDebugEnabled = log.isDebugEnabled (); ejbModuleName = ejbModule.getServiceName().toString(); // we register our inner-class to retrieve STATE notifications from our container // AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter (); filter.enableAttribute ("State"); this.container.getServer (). addNotificationListener (this.container.getEjbModule ().getServiceName (), new CleanShutdownInterceptor.StateChangeListener (), filter, null); // we need a way to find all CleanShutDownInterceptor of an EjbModule // ejbModule.putModuleData ("CleanShutDownInterceptor-" + this.container.getServiceName ().toString (), this); }
public void create () throws Exception { super.create (); // we register our inner-class to retrieve STATE notifications from our container // AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter (); filter.enableAttribute ("State"); // ************************************************************************ // NOTE: We could also subscribe for the container service events instead of the // ejbModule service events. This problem comes from beans using other beans // in the same ejbModule: we may receive an IllegalStateException thrown // by the Container implementation. Using ejbModule events solve this // problem. // ************************************************************************ this.container.getServer (). addNotificationListener (this.container.getEjbModule ().getServiceName (), new ProxyFactoryHA.StateChangeListener (), filter, null); }