Methods Summary |
---|
private static java.lang.String | camelCase(java.lang.String inputString)this method strips out all non-alpha characters; camelCases the result
String strippedString = stripNonAlphas(inputString);
String firstLetter = (strippedString.substring(0, 1)).toUpperCase();
String remainingPart =
(strippedString.substring(1, strippedString.length())).toLowerCase();
return firstLetter + remainingPart;
|
private static java.lang.String | createClassNameFrom(java.lang.String persistenceType)
StringBuffer sbuf = new StringBuffer();
sbuf.append(getEEPackage()).append(".")
.append(camelCase(persistenceType))
.append("TxStoreManager");
String classname = sbuf.toString();
return classname;
|
public static com.sun.ejb.spi.sfsb.store.SFSBTxStoreManager | createSFSBTxStoreManager(java.lang.String persistenceType)
if ("file".equalsIgnoreCase(persistenceType)) {
return new FileTxStoreManager();
}
String resolvedPersistenceType
= getResolvedPersistenceType(persistenceType);
Exception exception = null;
try {
String className = createClassNameFrom(resolvedPersistenceType);
return (SFSBTxStoreManager)
(Class.forName(className)).newInstance();
} catch (ClassNotFoundException cnfEx) {
exception = cnfEx;
_logger.log(Level.FINE,
"Exception while creating SFSBTxStoreManager for persistence "
+ "type: " + persistenceType + ". Exception: " + cnfEx);
} catch (Exception ex) {
exception = ex;
_logger.log(Level.FINE,
"Exception while creating SFSBTxStoreManager for "
+ "persistence type: " + persistenceType, ex);
}
if (_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "Created FileTxStoreManager for persistence"
+ " type: " + persistenceType, exception);
}
return new FileTxStoreManager();
|
private static java.lang.String | getEEPackage()return the path where the ee builders reside
although this method allows this to be configurable
via an property in server.xml we do not expose it
and it should not be re-configured
return DEFAULT_EE_PACKAGE;
|
private static java.lang.String | getResolvedPersistenceType(java.lang.String persistenceType)
String resolverClassName
= "com.sun.enterprise.ee.web.sessmgmt.EEPersistenceTypeResolver";
String resolvedPersistenceType = persistenceType;
PersistenceTypeResolver persistenceTypeResolver = null;
try {
persistenceTypeResolver =
(PersistenceTypeResolver) (Class.forName(resolverClassName)).newInstance();
if(persistenceTypeResolver != null) {
resolvedPersistenceType
= persistenceTypeResolver.resolvePersistenceType(persistenceType);
//this is because file not memory is the correct 'default'
if("memory".equalsIgnoreCase(resolvedPersistenceType)) {
resolvedPersistenceType = "file";
} else if("replicated".equalsIgnoreCase(resolvedPersistenceType)) {
//this is because replicated can make use of the same
//HaTxStoreManager that ha uses
resolvedPersistenceType = "ha";
}
}
} catch (Exception ex) {
_logger.log(Level.WARNING, "unable to create persistence type resolver");
}
return resolvedPersistenceType;
|
private static java.lang.String | stripNonAlphas(java.lang.String inputString)this method strips out all non-alpha characters
StringBuffer sb = new StringBuffer(50);
for(int i=0; i<inputString.length(); i++) {
char nextChar = inputString.charAt(i);
if(Character.isLetter(nextChar)) {
sb.append(nextChar);
}
}
return sb.toString();
|