Methods Summary |
---|
public java.lang.String | getAbstractBeanClassForEjbName(java.lang.String name)Gets the name of the abstract bean class which corresponds to the
specified ejb name.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ? descriptor.getEjbClassName() : null);
|
public java.lang.String | getAbstractSchemaForEjbName(java.lang.String name)Gets the name of the abstract schema which corresponds to the
specified ejb.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ?
descriptor.getAbstractSchemaName() : null);
|
public java.lang.String | getConcreteBeanClassForEjbName(java.lang.String name)Gets the name of the concrete bean class which corresponds to the
specified ejb.
IASEjbCMPEntityDescriptor descriptor =
getIASDescriptorForEjbName(name);
return ((descriptor != null) ? getQualifiedName(
getAbstractBeanClassForEjbName(name),
descriptor.getConcreteImplClassName()) : null);
|
public EjbCMPEntityDescriptor | getDescriptorForEjbName(java.lang.String name)Gets the EjbCMPEntityDescriptor which represents the ejb
with the specified name.
Map ejbMap = (Map)getMap().get(EJB_NAME);
Object descriptor = ejbMap.get(name);
return (((descriptor != null) &&
(descriptor instanceof EjbCMPEntityDescriptor)) ?
(EjbCMPEntityDescriptor)descriptor : null);
|
public java.lang.String | getEjbFieldForPersistenceField(java.lang.String className, java.lang.String fieldName)Gets the name of the field in the ejb which corresponds to the
specified persistence-capable class name and field name pair.
return fieldName;
|
public java.lang.String | getEjbNameForAbstractSchema(java.lang.String schemaName)Gets the name of the ejb which corresponds to the specified abstract
schema name.
Map abstractSchemaMap = (Map)getMap().get(ABSTRACT_SCHEMA_NAME);
return (String)abstractSchemaMap.get(schemaName);
|
public java.lang.String | getEjbNameForLocalInterface(java.lang.String ejbName, java.lang.String fieldName, java.lang.String interfaceName)Gets the name of the ejb which corresponds to the specified
local interface name.
EjbCMPEntityDescriptor descriptor =
getRelatedEjbDescriptor(ejbName, fieldName);
return (((descriptor != null) && !StringHelper.isEmpty(interfaceName)
&& interfaceName.equals(descriptor.getLocalClassName())) ?
descriptor.getName() : null);
|
public java.lang.String | getEjbNameForPersistenceClass(java.lang.String className)Gets the name of the ejb name which corresponds to the
specified persistence-capable class name.
Map pcMap = (Map)getMap().get(PERSISTENCE_NAME);
return (String)pcMap.get(className);
|
public java.lang.String | getEjbNameForRemoteInterface(java.lang.String ejbName, java.lang.String fieldName, java.lang.String interfaceName)Gets the name of the ejb which corresponds to the specified
remote interface name.
EjbCMPEntityDescriptor descriptor =
getRelatedEjbDescriptor(ejbName, fieldName);
return (((descriptor != null) && !StringHelper.isEmpty(interfaceName)
&& interfaceName.equals(descriptor.getRemoteClassName())) ?
descriptor.getName() : null);
|
private com.sun.enterprise.deployment.IASEjbCMPEntityDescriptor | getIASDescriptorForEjbName(java.lang.String name)
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return (((descriptor != null) &&
(descriptor instanceof IASEjbCMPEntityDescriptor)) ?
(IASEjbCMPEntityDescriptor)descriptor : null);
|
public java.lang.String | getKeyClassForEjbName(java.lang.String name)Gets the name of the key class which corresponds to the specified
ejb name.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ?
descriptor.getPrimaryKeyClassName() : null);
|
public java.lang.String | getLocalInterfaceForEjbName(java.lang.String name)Gets the name of the local interface which corresponds to the
specified ejb name.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ? descriptor.getLocalClassName() : null);
|
private java.util.Map | getMap() return _nameTypeToNameMap;
|
private java.lang.String | getPersistenceClassForDescriptor(EjbCMPEntityDescriptor descriptor)
String pcName = ((descriptor instanceof IASEjbCMPEntityDescriptor) ?
((IASEjbCMPEntityDescriptor)descriptor).getPcImplClassName() :
null);
// use the package name, keep the ejb name
if ((pcName != null) && !_expandPCNames)
{
pcName = JavaTypeHelper.getPackageName(pcName) +
'." + descriptor.getName();
}
return pcName;
|
public java.lang.String | getPersistenceClassForEjbName(java.lang.String name)Gets the name of the persistence-capable class which corresponds to
the specified ejb name.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ?
getPersistenceClassForDescriptor(descriptor) : null);
|
public java.lang.String | getPersistenceFieldForEjbField(java.lang.String name, java.lang.String fieldName)Gets the name of the field in the persistence-capable class which
corresponds to the specified ejb name and field name pair.
return fieldName;
|
private java.lang.String | getQualifiedName(java.lang.String classNameWithPackage, java.lang.String classNameToQualify)
if (!StringHelper.isEmpty(classNameToQualify))
{
String packageName =
JavaTypeHelper.getPackageName(classNameToQualify);
if (StringHelper.isEmpty(packageName)) // not already qualified
{
packageName =
JavaTypeHelper.getPackageName(classNameWithPackage);
if (!StringHelper.isEmpty(packageName))
return packageName + '." + classNameToQualify;
}
}
return classNameToQualify;
|
private EjbCMPEntityDescriptor | getRelatedEjbDescriptor(java.lang.String ejbName, java.lang.String ejbFieldName)
EjbCMPEntityDescriptor descriptor = ((ejbName != null) ?
getDescriptorForEjbName(ejbName) : null);
if (descriptor != null)
{
PersistenceDescriptor persistenceDescriptor =
descriptor.getPersistenceDescriptor();
CMRFieldInfo cmrf =
persistenceDescriptor.getCMRFieldInfoByName(ejbFieldName);
return cmrf.role.getPartner().getOwner();
}
return null;
|
public java.lang.String | getRemoteInterfaceForEjbName(java.lang.String name)Gets the name of the remote interface which corresponds to the
specified ejb name.
EjbCMPEntityDescriptor descriptor = getDescriptorForEjbName(name);
return ((descriptor != null) ? descriptor.getRemoteClassName() : null);
|
private void | initMap()
Iterator iterator = getBundleDescriptor().getEjbs().iterator();
Map ejbMap = new HashMap();
Map persistenceClassMap = new HashMap();
Set localNames = new HashSet();
Set remoteNames = new HashSet();
Map abstractSchemaMap = new HashMap();
_nameTypeToNameMap = new HashMap();
while (iterator.hasNext())
{
Object next = iterator.next();
if (next instanceof IASEjbCMPEntityDescriptor)
{
IASEjbCMPEntityDescriptor descriptor =
(IASEjbCMPEntityDescriptor)next;
String ejbName = descriptor.getName();
ejbMap.put(ejbName, descriptor);
safePut(persistenceClassMap,
getPersistenceClassForDescriptor(descriptor), ejbName);
safeAdd(localNames, descriptor.getLocalClassName());
safeAdd(remoteNames, descriptor.getRemoteClassName());
safePut(abstractSchemaMap,
descriptor.getAbstractSchemaName(), ejbName);
}
}
_nameTypeToNameMap.put(EJB_NAME, ejbMap);
_nameTypeToNameMap.put(PERSISTENCE_NAME, persistenceClassMap);
_nameTypeToNameMap.put(LOCAL_NAME, localNames);
_nameTypeToNameMap.put(REMOTE_NAME, remoteNames);
_nameTypeToNameMap.put(ABSTRACT_SCHEMA_NAME, abstractSchemaMap);
|
public boolean | isEjbName(java.lang.String name)Determines if the specified name represents an ejb.
return mapContainsKey(EJB_NAME, name);
|
public boolean | isLocalInterface(java.lang.String name)Determines if the specified name represents a local interface.
return mapContainsKey(LOCAL_NAME, name);
|
public boolean | isRemoteInterface(java.lang.String name)Determines if the specified name represents a remote interface.
return mapContainsKey(REMOTE_NAME, name);
|
private boolean | mapContainsKey(java.lang.String stringIndex, java.lang.String name)
Object mapObject = getMap().get(stringIndex);
Set testSet = ((mapObject instanceof Set) ? (Set)mapObject :
((Map)mapObject).keySet());
return ((name != null) ? testSet.contains(name) : false);
|
private void | safeAdd(java.util.Set set, java.lang.Object value)
if ((value != null) && (set != null))
set.add(value);
|
private void | safePut(java.util.Map map, java.lang.Object key, java.lang.Object value)
if ((key != null) && (map != null))
map.put(key, value);
|