Methods Summary |
---|
public java.lang.String | getAbstractSchemaName()
return abstractSchemaName;
|
public int | getCMPVersion()Returns CMP version as an enum type.
if (cmpVersion == UNDEFINED) {
if (getEjbBundleDescriptor()!=null) {
String bundleVersion = getEjbBundleDescriptor().getSpecVersion();
if (bundleVersion.startsWith("1.")) {
cmpVersion = CMP_1_1;
} else {
cmpVersion = CMP_2_x;
}
} else {
// we cannot get the version from the bundle, set it to default...
cmpVersion = CMP_2_x;
}
}
return cmpVersion;
|
public java.lang.String | getEjbImplementationImplClassName()
return ejbImplementationImplClassName;
|
public java.util.Vector | getFieldDescriptors()
Vector fieldDescriptors = new Vector();
if( isEJB20() ) {
try {
ClassLoader cl = getEjbBundleDescriptor().getClassLoader();
fieldDescriptors = BeanMethodCalculator.getPossibleCmpCmrFields
(cl, this.getEjbClassName());
} catch(Throwable t) {
String errorMsg = localStrings.getLocalString
("enterprise.deployment.errorloadingejbclass",
"error loading the ejb class {0} in getFields" +
" on EjbDescriptor\n {1}",
new Object[] {this.getEjbClassName(), t.toString() });
_logger.log(Level.FINE,errorMsg);
}
} else {
fieldDescriptors = super.getFieldDescriptors();
}
return fieldDescriptors;
|
public java.util.Vector | getFields()
Vector fields = new Vector();
if( isEJB20() ) {
// All cmp "fields" are abstract, so we can't construct
// java.lang.reflect.Field elements from them. Use
// getFieldDescriptors() instead.
} else {
fields = super.getFields();
}
return fields;
|
public PersistenceDescriptor | getPersistenceDescriptor()
if (pers==null) {
pers = new PersistenceDescriptor();
this.setPersistenceDescriptor(pers);
}
return pers;
|
public static java.util.Vector | getPossibleCmpCmrFields(java.lang.ClassLoader cl, java.lang.String className)
Vector fieldDescriptors = new Vector();
Class theClass = cl.loadClass(className);
// Start with all *public* methods
Method[] methods = theClass.getMethods();
// Find all accessors that could be cmp fields. This list
// will contain all cmr field accessors as well, since there
// is no good way to distinguish between the two purely based
// on method signature.
for(int mIndex = 0; mIndex < methods.length; mIndex++) {
Method next = methods[mIndex];
String nextName = next.getName();
int nextModifiers = next.getModifiers();
if( Modifier.isAbstract(nextModifiers) ) {
if( nextName.startsWith(FIELD_ACCESS_METHOD_PREFIX) &&
nextName.length() > 3 ) {
String field =
nextName.substring(3,4).toLowerCase() +
nextName.substring(4);
fieldDescriptors.add(new FieldDescriptor(field));
}
}
}
return fieldDescriptors;
|
public java.util.Vector | getPossibleTransactionAttributes()
Vector txAttributes = null;
if( isEJB20() ) {
txAttributes = new Vector();
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRED, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRES_NEW, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.MANDATORY, ""));
if( isTimedObject() ) {
txAttributes.add(new ContainerTransaction
(ContainerTransaction.NOT_SUPPORTED, ""));
}
} else {
txAttributes = super.getPossibleTransactionAttributes();
}
return txAttributes;
|
public FieldDescriptor | getPrimaryKeyFieldDesc()
return primaryKeyFieldDesc;
|
public java.lang.String | getStateImplClassName()Returns the classname of the State class impl.
return this.stateImplClassName;
|
private void | invalidatePersistenceInfo()
if( pers != null ) {
pers.invalidate();
}
|
public boolean | isEJB20()return true if this is an EJB2.0 CMP Entitybean
DEPRECATED
return getCMPVersion()==CMP_2_x;
|
public void | print(java.lang.StringBuffer toStringBuffer)Return my formatted string representation.
super.print(toStringBuffer);
toStringBuffer.append("\n cmpVersion ").append(cmpVersion).
append("\n primKeyField ");
if(getPrimaryKeyFieldDesc() != null)
((Descriptor)getPrimaryKeyFieldDesc()).print(toStringBuffer);
if(pers != null)
((Descriptor)pers).print(toStringBuffer);
|
public void | setAbstractSchemaName(java.lang.String abstractSchemaName)
this.abstractSchemaName = abstractSchemaName;
|
public void | setCMPVersion(int version)Set the CMP version
if (version==CMP_1_1 || version == CMP_2_x) {
cmpVersion = version;
} else {
throw new IllegalArgumentException(localStrings.getLocalString("enterprise.deployment.invalidcmpversion",
"Invalid CMP version: {0}.",
new Object[]{Integer.valueOf(version)})); // NOI18N
}
|
public void | setEjbBundleDescriptor(EjbBundleDescriptor bundleDescriptor)
super.setEjbBundleDescriptor(bundleDescriptor);
|
public void | setEjbImplementationImplClassName(java.lang.String className)set the generated implementation class for a CMP 2.0 Ejb object
ejbImplementationImplClassName = className;
|
public void | setPersistenceDescriptor(PersistenceDescriptor pd)
this.pers = pd;
pd.setParentDescriptor(this);
|
public void | setPrimaryKeyFieldDesc(FieldDescriptor pkf)
this.primaryKeyFieldDesc = pkf;
invalidatePersistenceInfo();
|
public void | setStateImplClassName(java.lang.String name)Sets the State class implementation classname.
this.stateImplClassName = name;
|
public void | visit(com.sun.enterprise.deployment.util.EjbVisitor aVisitor)visit the descriptor and all sub descriptors with a DOL visitor implementation
super.visit(aVisitor);
PersistenceDescriptor persistenceDesc = getPersistenceDescriptor();
for (Iterator e=persistenceDesc.getCMPFields().iterator();e.hasNext();) {
FieldDescriptor fd = (FieldDescriptor) e.next();
aVisitor.accept(fd);
}
for (Iterator e=persistenceDesc.getQueriedMethods().iterator();e.hasNext();) {
Object method = e.next();
if (method instanceof MethodDescriptor) {
QueryDescriptor qd = persistenceDesc.getQueryFor((MethodDescriptor) method);
aVisitor.accept((MethodDescriptor) method, qd);
}
}
|