use of com.sun.enterprise.deployment.MethodDescriptor in project Payara by payara.
the class PersistenceDescriptor method initializeAllQueriedMethods.
private void initializeAllQueriedMethods() {
allQueriedMethods = new HashSet();
// add all ejbSelect* methods in persistentClass
Method[] beanMethods = getPersistentClass().getMethods();
for (int i = 0; i < beanMethods.length; i++) {
if (beanMethods[i].getName().startsWith("ejbSelect")) {
allQueriedMethods.add(new MethodDescriptor(beanMethods[i], MethodDescriptor.EJB_BEAN));
}
}
// add all finders in Home/LocalHome intf, findByPrimaryKey too
if (parentDesc.isRemoteInterfacesSupported()) {
Class homeIntf = getClass(parentDesc.getHomeClassName());
Method[] homeMethods = homeIntf.getMethods();
for (int i = 0; i < homeMethods.length; i++) {
String name = homeMethods[i].getName();
if (name.startsWith("find") && !name.equals("findByPrimaryKey")) {
allQueriedMethods.add(new MethodDescriptor(homeMethods[i], MethodDescriptor.EJB_HOME));
}
}
}
if (parentDesc.isLocalInterfacesSupported()) {
Class homeIntf = getClass(parentDesc.getLocalHomeClassName());
Method[] homeMethods = homeIntf.getMethods();
for (int i = 0; i < homeMethods.length; i++) {
String name = homeMethods[i].getName();
if (name.startsWith("find") && !name.equals("findByPrimaryKey")) {
allQueriedMethods.add(new MethodDescriptor(homeMethods[i], MethodDescriptor.EJB_LOCALHOME));
}
}
}
}
use of com.sun.enterprise.deployment.MethodDescriptor in project Payara by payara.
the class CheckpointAtEndOfMethodDescriptor method convertStyleCheckpointedMethods.
private void convertStyleCheckpointedMethods() {
Set allMethods = ejbDescriptor.getMethodDescriptors();
for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext(); ) {
MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();
// the ejb-name element defined in the method element will
// be always ignored and overriden by the one defined in
// ejb element
methodDesc.setEjbName(ejbDescriptor.getName());
// Convert to style 3 method descriptors
Vector mds = methodDesc.doStyleConversion(ejbDescriptor, allMethods);
convertedMethodDescs.addAll(mds);
}
}
use of com.sun.enterprise.deployment.MethodDescriptor in project Payara by payara.
the class FlushAtEndOfMethodDescriptor method convertStyleFlushedMethods.
private void convertStyleFlushedMethods() {
Set allMethods = ejbDescriptor.getMethodDescriptors();
for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext(); ) {
MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();
// the ejb-name element defined in the method element will
// be always ignored and overriden by the one defined in
// ejb element
methodDesc.setEjbName(ejbDescriptor.getName());
// Convert to style 3 method descriptors
Vector mds = methodDesc.doStyleConversion(ejbDescriptor, allMethods);
convertedMethodDescs.addAll(mds);
}
}
use of com.sun.enterprise.deployment.MethodDescriptor in project Payara by payara.
the class IASEjbExtraDescriptors method parseCheckpointedMethod.
// parse the given method string into a MethodDescriptor
private MethodDescriptor parseCheckpointedMethod(String method) {
String methodName, methodParams;
ArrayList paramTypeList = new ArrayList();
try {
if (method.indexOf(LEFT_PAREN) != -1 && method.indexOf(RIGHT_PAREN) != -1) {
int pos = method.indexOf(LEFT_PAREN);
int pos2 = method.indexOf(RIGHT_PAREN);
// retrieve the method name
methodName = method.substring(0, pos).trim();
// retrieve the parameter list
if (pos < pos2 - 1) {
methodParams = method.substring(pos + 1, pos2).trim();
StringTokenizer paramsTokenizer = new StringTokenizer(methodParams, PARAMS_DELIM);
while (paramsTokenizer.hasMoreTokens()) {
// process each param
String param = paramsTokenizer.nextToken().trim();
if (param.length() == 0) {
continue;
}
StringTokenizer paramTokenizer = new StringTokenizer(param, PARAM_DELIM);
while (paramTokenizer.hasMoreTokens()) {
String paramType = paramTokenizer.nextToken().trim();
if (paramType.length() != 0) {
paramTypeList.add(paramType);
// only interested in the first token
break;
}
}
}
}
if (paramTypeList.size() > 0) {
String[] paramTypeArray = (String[]) paramTypeList.toArray(new String[paramTypeList.size()]);
return new MethodDescriptor(methodName, null, paramTypeArray, null);
} else {
return new MethodDescriptor(methodName, null, null, null);
}
} else {
DOLUtils.getDefaultLogger().log(Level.WARNING, "enterprise.deployment_badformat_checkpointedmethods", new Object[] { method });
return null;
}
} catch (Exception e) {
// any parsing exception indicates it is not a well-formed
// string, we will just print warning and return null
DOLUtils.getDefaultLogger().log(Level.WARNING, "enterprise.deployment_badformat_checkpointedmethods", new Object[] { method });
DOLUtils.getDefaultLogger().log(Level.WARNING, e.getMessage(), e);
return null;
}
}
use of com.sun.enterprise.deployment.MethodDescriptor in project Payara by payara.
the class PrefetchDisabledDescriptor method convertStylePrefetchDisabledMethods.
private void convertStylePrefetchDisabledMethods() {
Set allMethods = ejbDescriptor.getMethodDescriptors();
for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext(); ) {
MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();
// the ejb-name element defined in the method element will
// be always ignored and overriden by the one defined in
// ejb element
methodDesc.setEjbName(ejbDescriptor.getName());
// Convert to style 3 method descriptors
Vector mds = methodDesc.doStyleConversion(ejbDescriptor, allMethods);
convertedMethodDescs.addAll(mds);
}
}
Aggregations