/**
  * Initializes a bean configuration instance from the passed configuration node.
  *
  * @param \AppserverIo\Description\Configuration\ConfigurationInterface $configuration The bean configuration
  *
  * @return void
  */
 public function fromConfiguration(ConfigurationInterface $configuration)
 {
     // query for the class name and set it
     if ($className = (string) $configuration->getEpbClass()) {
         $this->setClassName(DescriptorUtil::trim($className));
     }
     // query for the name and set it
     if ($name = (string) $configuration->getEpbName()) {
         $this->setName(DescriptorUtil::trim($name));
     }
     // initialize references from the passed deployment descriptor
     $this->referencesFromConfiguration($configuration);
 }
 /**
  * Initializes a bean descriptor instance from the passed configuration node.
  *
  * @param \AppserverIo\Description\Configuration\ConfigurationInterface $configuration The configuration node with the bean configuration
  *
  * @return \AppserverIo\Psr\EnterpriseBeans\Description\SingletonSessionBeanDescriptorInterface|null The initialized descriptor instance
  */
 public function fromConfiguration(ConfigurationInterface $configuration)
 {
     // query whether or not we've a session bean configuration
     if (!$configuration instanceof SessionConfigurationInterface) {
         return;
     }
     // query wheter or not the session type matches
     if ((string) $configuration->getSessionType() !== SingletonSessionBeanDescriptor::SESSION_TYPE) {
         return;
     }
     // initialize the descriptor instance
     parent::fromConfiguration($configuration);
     // initialize the post detach callback methods
     if ($postDetach = $configuration->getPostDetach()) {
         foreach ($postDetach->getLifecycleCallbackMethods() as $postDetachCallback) {
             $this->addPostDetachCallback(DescriptorUtil::trim((string) $postDetachCallback));
         }
     }
     // initialize the pre attach callback methods
     if ($preAttach = $configuration->getPreAttach()) {
         foreach ($preAttach->getLifecycleCallbackMethods() as $preAttachCallback) {
             $this->addPreAttachCallback(DescriptorUtil::trim((string) $preAttachCallback));
         }
     }
     // query for the startup flag
     if ($initOnStartup = (string) $configuration->getInitOnStartup()) {
         $this->setInitOnStartup(Boolean::valueOf(new String($initOnStartup))->booleanValue());
     }
     // return the instance
     return $this;
 }
 /**
  * Initializes a bean descriptor instance from the passed configuration node.
  *
  * @param \AppserverIo\Description\Configuration\ConfigurationInterface $configuration The configuration node with the bean description
  *
  * @return void
  */
 public function fromConfiguration(ConfigurationInterface $configuration)
 {
     // query whether or not we've a session bean configuration
     if (!$configuration instanceof SessionConfigurationInterface) {
         return;
     }
     // initialize the bean descriptor
     parent::fromConfiguration($configuration);
     // query for the session type and set it
     if ($sessionType = (string) $configuration->getSessionType()) {
         $this->setSessionType($sessionType);
     }
     // query for the name of the local business interface and set it
     if ($local = (string) $configuration->getLocal()) {
         $this->setLocal($local);
     } else {
         $this->setLocal(sprintf('%sLocal', rtrim($this->getName(), 'Bean')));
     }
     // query for the name of the remote business interface and set it
     if ($remote = (string) $configuration->getRemote()) {
         $this->setRemote($remote);
     } else {
         $this->setRemote(sprintf('%sRemote', rtrim($this->getName(), 'Bean')));
     }
     // initialize the post construct callback methods
     if ($postConstructNode = $configuration->getPostConstruct()) {
         foreach ($postConstructNode->getLifecycleCallbackMethods() as $postConstructCallback) {
             $this->addPostConstructCallback(DescriptorUtil::trim((string) $postConstructCallback));
         }
     }
     // initialize the pre destroy callback methods
     if ($preDestroyNode = $configuration->getPreDestroy()) {
         foreach ($preDestroyNode->getLifecycleCallbackMethods() as $preDestroyCallback) {
             $this->addPreDestroyCallback(DescriptorUtil::trim((string) $preDestroyCallback));
         }
     }
 }
 /**
  * Initializes a bean descriptor instance from the passed configuration node.
  *
  * @param \AppserverIo\Description\Configuration\ConfigurationInterface $configuration The configuration node with the bean configuration
  *
  * @return \AppserverIo\Psr\EnterpriseBeans\Description\StatefulSessionBeanDescriptorInterface|null The initialized descriptor instance
  */
 public function fromConfiguration(ConfigurationInterface $configuration)
 {
     // query whether or not we've a session bean configuration
     if (!$configuration instanceof SessionConfigurationInterface) {
         return;
     }
     // query wheter or not the session type matches
     if ((string) $configuration->getSessionType() !== StatefulSessionBeanDescriptor::SESSION_TYPE) {
         return;
     }
     // initialize the descriptor instance
     parent::fromConfiguration($configuration);
     // initialize the post detach callback methods
     if ($postDetach = $configuration->getPostDetach()) {
         foreach ($postDetach->getLifecycleCallbackMethods() as $postDetachCallback) {
             $this->addPostDetachCallback(DescriptorUtil::trim((string) $postDetachCallback));
         }
     }
     // initialize the pre attach callback methods
     if ($preAttach = $configuration->getPreAttach()) {
         foreach ($preAttach->getLifecycleCallbackMethods() as $preAttachCallback) {
             $this->addPreAttachCallback(DescriptorUtil::trim((string) $preAttachCallback));
         }
     }
     // initialize the post activate callback methods
     if ($postActivate = $configuration->getPostActivate()) {
         foreach ($postActivate->getLifecycleCallbackMethods() as $postActivateCallback) {
             $this->addPostActivateCallback(DescriptorUtil::trim((string) $postActivateCallback));
         }
     }
     // initialize the pre passivate callback methods
     if ($prePassivate = $configuration->getPrePassivate()) {
         foreach ($prePassivate->getLifecycleCallbackMethods() as $prePassivateCallback) {
             $this->addPrePassivateCallback(DescriptorUtil::trim((string) $prePassivateCallback));
         }
     }
     // initialize the remove methods
     if ($removeMethod = $configuration->getRemoveMethod()) {
         foreach ($removeMethod->getMethodNames() as $methodName) {
             $this->addRemoveMethod(DescriptorUtil::trim((string) $methodName));
         }
     }
     // return the instance
     return $this;
 }