Methods Summary |
---|
protected void | createProxyFactories()
|
protected java.lang.String | getAspectDomain(int ejbIndex, java.lang.String defaultDomain)
return EJB3Util.getAspectDomain(visible, defaultDomain);
|
protected org.jboss.ejb3.mdb.ConsumerContainer | getConsumerContainer(int ejbIndex)
String containerName = getAspectDomain(ejbIndex, defaultConsumerDomain);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
throw new RuntimeException("No container configured with name '"
+ containerName + "''");
return new ConsumerContainer(ejbNames.get(ejbIndex), (AspectManager) domain.getManager(),
di.getClassLoader(), className, ctxProperties,
di.getInterceptorInfoRepository(), deployment);
|
public java.util.List | getContainers(Ejb3Deployment deployment)
List containers = new ArrayList();
populateBaseInfo();
for (int ejbIndex = 0; ejbIndex < ejbNames.size(); ++ejbIndex)
{
String ejbName = ejbNames.get(ejbIndex);
if (ejbType == EJB_TYPE.STATELESS)
{
EJBContainer container = getStatelessContainer(ejbIndex);
container.setJaccContextId(getJaccContextId());
containers.add(container);
}
else if (ejbType == EJB_TYPE.STATEFUL)
{
StatefulContainer container = getStatefulContainer(ejbIndex);
container.setJaccContextId(getJaccContextId());
containers.add(container);
}
else if (ejbType == EJB_TYPE.MESSAGE_DRIVEN)
{
MDB container = getMDB(ejbIndex);
validateMDBTransactionAttribute(container);
container.setJaccContextId(getJaccContextId());
containers.add(container);
}
else if (ejbType == EJB_TYPE.SERVICE)
{
ServiceContainer container = getServiceContainer(ejbIndex);
container.setJaccContextId(getJaccContextId());
containers.add(container);
}
else if (ejbType == EJB_TYPE.CONSUMER)
{
ConsumerContainer container = getConsumerContainer(ejbIndex);
container.setJaccContextId(getJaccContextId());
containers.add(container);
}
log.debug("found EJB3: ejbName=" + ejbName + ", class=" + className + ", type=" + ejbType);
}
return containers;
|
protected java.lang.String | getJaccContextId()
return di.getShortName();
|
protected org.jboss.ejb3.mdb.MDB | getMDB(int ejbIndex)
return getMDB(ejbIndex, null);
|
protected org.jboss.ejb3.mdb.MDB | getMDB(int ejbIndex, org.jboss.ejb3.metamodel.EnterpriseBean xml)
String domainName = getMDBDomainName(ejbIndex);
String containerName = getAspectDomain(ejbIndex, domainName);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
throw new RuntimeException("No container configured with name '"
+ containerName + "''");
MDB container = new MDB(ejbNames.get(ejbIndex), (AspectManager) domain.getManager(), di.getClassLoader(), className,
ctxProperties, di.getInterceptorInfoRepository(), deployment);
return container;
|
protected java.lang.String | getMDBDomainName(int ejbIndex)
return defaultMDBDomain;
|
protected org.jboss.ejb3.service.ServiceContainer | getServiceContainer(int ejbIndex)
String containerName = getAspectDomain(ejbIndex, defaultServiceDomain);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
throw new RuntimeException("No container configured with name '"
+ containerName + "''");
return new ServiceContainer(deployment.getMbeanServer(), di.getClassLoader(), className,
ejbNames.get(ejbIndex), (AspectManager) domain.getManager(), ctxProperties,
di.getInterceptorInfoRepository(), deployment);
|
protected org.jboss.ejb3.stateful.StatefulContainer | getStatefulContainer(int ejbIndex)
String containerName = getAspectDomain(ejbIndex, defaultSFSBDomain);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
throw new RuntimeException("No container configured with name '"
+ containerName + "''");
return new StatefulContainer(di.getClassLoader(), className,
ejbNames.get(ejbIndex), (AspectManager) domain.getManager(), ctxProperties,
di.getInterceptorInfoRepository(), deployment);
|
protected EJBContainer | getStatelessContainer(int ejbIndex)
String containerName = getAspectDomain(ejbIndex, defaultSLSBDomain);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
throw new RuntimeException("No container configured with name '"
+ containerName + "''");
return new StatelessContainer(di.getClassLoader(), className,
ejbNames.get(ejbIndex), (AspectManager) domain.getManager(),
ctxProperties, di.getInterceptorInfoRepository(),
deployment);
|
public boolean | isEjb()
if (visible == null) return false;
if (EJB3Util.isStateless(visible)) return true;
if (EJB3Util.isMessageDriven(visible)) return true;
if (EJB3Util.isStatefulSession(visible)) return true;
return false;
|
public boolean | isJBossBeanType()
if (visible == null) return false;
if (EJB3Util.isService(visible)) return true;
if (EJB3Util.isConsumer(visible)) return true;
return false;
|
protected void | populateBaseInfo()
String ejbName = null;
ejbClass = di.getClassLoader().loadClass(className);
visible = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag);
if (visible != null)
{
annotation = visible.getAnnotation(javax.ejb.Stateless.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.STATELESS;
}
else
{
annotation = visible.getAnnotation(javax.ejb.Stateful.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.STATEFUL;
}
else
{
annotation = visible.getAnnotation(javax.persistence.Entity.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.ENTITY;
}
else
{
annotation = visible.getAnnotation(javax.ejb.MessageDriven.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.MESSAGE_DRIVEN;
}
else
{
annotation = visible.getAnnotation(org.jboss.annotation.ejb.Service.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.SERVICE;
}
else
{
annotation = visible.getAnnotation(org.jboss.annotation.ejb.Consumer.class.getName());
if (annotation != null)
{
ejbType = EJB_TYPE.CONSUMER;
}
}
}
}
}
}
if (annotation != null)
{
StringMemberValue mv = (StringMemberValue) annotation.getMemberValue("name");
if (mv != null)
ejbName = mv.getValue();
else
ejbName = ejbClass.getSimpleName();
}
}
if (ejbName != null)
{
ejbNames.add(ejbName);
}
|
public void | setCtxProperties(java.util.Hashtable ctxProperties)
this.ctxProperties = ctxProperties;
|
protected void | validateMDBTransactionAttribute(org.jboss.ejb3.mdb.MDB mdb)
TransactionAttribute tx = (TransactionAttribute)mdb.resolveAnnotation(TransactionAttribute.class);
if (tx != null)
{
TransactionAttributeType type = tx.value();
if (type != TransactionAttributeType.REQUIRED && type != TransactionAttributeType.NOT_SUPPORTED)
throw new RuntimeException("MDB " + mdb.getEjbName() + " has an invalid TransactionAttribute: " + type +
". Only REQUIRED and NOT_SUPPORTED are valid");
}
|