You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/10/05 20:01:48 UTC
svn commit: r295058 [1/2] - in /beehive/trunk/system-controls: ./
external/commons/ src/ejb/org/apache/beehive/controls/system/ejb/
src/ejb/org/apache/beehive/controls/system/ejb/internal/
src/jdbc/org/apache/beehive/controls/system/jdbc/ src/jms/org/a...
Author: ekoneil
Date: Wed Oct 5 11:01:26 2005
New Revision: 295058
URL: http://svn.apache.org/viewcvs?rev=295058&view=rev
Log:
Lots of general cleanup in the system controls.
- consistent code formatting
- rename the .jcs files to .java so that they behave better in an IDE
- remove the unused commons-collections.jar file that was in the EJB control classpath
BB: self
Test: system controls pass
Added:
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.java
- copied, changed from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.jcs
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.java
- copied, changed from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.jcs
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java
- copied, changed from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.jcs
beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java
- copied unchanged from r292004, beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.jcs
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.java
- copied, changed from r292004, beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jndi/impl/JndiControlImpl.java
- copied, changed from r292004, beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jndi/impl/JndiControlImpl.jcs
beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java
- copied unchanged from r292004, beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs
Removed:
beehive/trunk/system-controls/external/commons/
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.jcs
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.jcs
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.jcs
beehive/trunk/system-controls/src/jdbc/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.jcs
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/impl/JMSControlImpl.jcs
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jndi/impl/JndiControlImpl.jcs
beehive/trunk/system-controls/src/webservice/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.jcs
Modified:
beehive/trunk/system-controls/build.xml
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBInfo.java
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControl.java
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControl.java
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/WebDescriptorHandler.java
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/JMSControl.java
beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jndi/JndiControl.java
beehive/trunk/system-controls/systemcontrols-imports.xml
Modified: beehive/trunk/system-controls/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/build.xml?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/build.xml (original)
+++ beehive/trunk/system-controls/build.xml Wed Oct 5 11:01:26 2005
@@ -60,6 +60,10 @@
<ant dir="${basedir}/test/src/webservice" target="drt" inheritAll="false"/>
</target>
+ <target name="ejb.drt" description="Runs the EJB Control DRT">
+ <ant dir="${basedir}/test/ejb" target="test" inheritAll="false"/>
+ </target>
+
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.lib.dir}"/>
Copied: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.java (from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.jcs)
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.java?p2=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.java&p1=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.jcs&r1=292004&r2=295058&rev=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.jcs (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBControlImpl.java Wed Oct 5 11:01:26 2005
@@ -47,47 +47,41 @@
* The Enterprise Java Bean Control implementation class
*/
@ControlImplementation
-abstract public class EJBControlImpl
+public abstract class EJBControlImpl
implements EJBControl, Extensible, java.io.Serializable {
static final long serialVersionUID = 1L;
- static public final int SESSION_BEAN = 1;
- static public final int ENTITY_BEAN = 2;
+ public static final int SESSION_BEAN = 1;
+ public static final int ENTITY_BEAN = 2;
- static public final String JNDI_GLOBAL_PREFIX = "jndi:";
- static public final String JNDI_APPSCOPED_PREFIX = "java:comp/env/";
+ public static final String JNDI_GLOBAL_PREFIX = "jndi:";
+ public static final String JNDI_APPSCOPED_PREFIX = "java:comp/env/";
- @EventHandler(field="context", eventSet=LifeCycle.class, eventName="onCreate")
- public void onCreate()
- {
+ @EventHandler(field = "context", eventSet = LifeCycle.class, eventName = "onCreate")
+ public void onCreate() {
// first time initialization
// assume v2 attributes
- EJBHome ejbHome = (EJBHome)context.getControlPropertySet(EJBHome.class);
+ EJBHome ejbHome = (EJBHome) context.getControlPropertySet(EJBHome.class);
if (ejbHome == null)
- {
throw new ControlException("No @EJBHome property is defined");
- }
+
_jndiName = ejbHome.jndiName();
- if (_jndiName == null || _jndiName.length() == 0)
- {
+ if (_jndiName == null || _jndiName.length() == 0) {
String ejbLink = ejbHome.ejbLink();
- if (ejbLink.length() == 0)
- {
+ if (ejbLink.length() == 0) {
//
// Should be caught by the compiler
//
- throw new ControlException(
- "Either the jndiName() or ejbLink() member of @EJBHome must be defined.");
+ throw new ControlException("Either the jndiName() or ejbLink() member of @EJBHome must be defined.");
}
//
// Generate a unique local jndi name to associate w/ the link,
// based upon the local control service uri and control id
//
- _jndiName = JNDI_APPSCOPED_PREFIX +
- EJBInfo.getEJBRefName(context.getControlInterface());
+ _jndiName = JNDI_APPSCOPED_PREFIX + EJBInfo.getEJBRefName(context.getControlInterface());
}
// Obtain the JCX interface and identify the home/remote
@@ -96,11 +90,9 @@
_homeInterface = beanInfo._homeInterface;
_beanInterface = beanInfo._beanInterface;
_beanType = beanInfo._beanType.equals("Session") ? SESSION_BEAN : ENTITY_BEAN;
-
}
- static protected boolean methodThrows(Method m, Class exceptionClass)
- {
+ protected static boolean methodThrows(Method m, Class exceptionClass) {
Class [] exceptions = m.getExceptionTypes();
for (int j = 0; j < exceptions.length; j++)
if (exceptionClass.isAssignableFrom(exceptions[j]))
@@ -108,52 +100,40 @@
return false;
}
- protected boolean isHomeMethod(Method m)
- {
- return m.getDeclaringClass().isAssignableFrom(_homeInterface);
+ protected boolean isHomeMethod(Method m) {
+ return m.getDeclaringClass().isAssignableFrom(_homeInterface);
}
- static protected boolean isCreateMethod(Method m)
- {
+ protected static boolean isCreateMethod(Method m) {
return methodThrows(m, CreateException.class);
}
- static protected boolean isFinderMethod(Method m)
- {
+ protected static boolean isFinderMethod(Method m) {
if (!m.getName().startsWith("find")) // EJB enforced pattern
return false;
return methodThrows(m, FinderException.class);
}
- protected boolean isSelectorMethod(Method m)
- {
- if (isHomeMethod(m) &&
- m.getReturnType().equals(_beanInterface))
- return true;
- return false;
+ protected boolean isSelectorMethod(Method m) {
+ return isHomeMethod(m) && m.getReturnType().equals(_beanInterface);
}
- static protected boolean isRemoveMethod(Method m)
- {
- if (!m.getName().equals("remove") ||
- (m.getParameterTypes().length != 0))
+ static protected boolean isRemoveMethod(Method m) {
+ if (!m.getName().equals("remove") || (m.getParameterTypes().length != 0))
return false;
-
- return true;
+ else return true;
}
- protected Object homeNarrow(Object obj)
- {
+ protected Object homeNarrow(Object obj) {
if (javax.ejb.EJBHome.class.isAssignableFrom(_homeInterface))
return PortableRemoteObject.narrow(obj, _homeInterface);
- return obj;
+ else return obj;
}
- protected Object beanNarrow(Object obj)
- {
+ protected Object beanNarrow(Object obj) {
if (javax.ejb.EJBObject.class.isAssignableFrom(_beanInterface))
return PortableRemoteObject.narrow(obj, _beanInterface);
- return obj;
+ else return obj;
}
/*
@@ -170,17 +150,14 @@
// Is there is a cached EJB handle associated with this bean, then
// is it to restore the associate EJB object reference.
//
- protected Object resolveBeanInstanceFromHandle()
- {
+ protected Object resolveBeanInstanceFromHandle() {
if (_beanHandle == null)
return null;
- try
- {
+ try {
return _beanHandle.getEJBObject();
}
- catch (java.rmi.RemoteException re)
- {
+ catch (java.rmi.RemoteException re) {
throw new ControlException("Unable to convert EJB handle to object", re);
}
}
@@ -189,8 +166,7 @@
// Attempts to save the contents of the current bean reference in persisted
// control state. Returns true if state could be saved, false otherwise
//
- protected boolean saveBeanInstance()
- {
+ protected boolean saveBeanInstance() {
// Nothing to save == success
if (_beanInstance == null)
return true;
@@ -198,14 +174,11 @@
//
// Save using a bean handle, but handles only exist for remote objects.
//
- if (_beanInstance instanceof EJBObject)
- {
- try
- {
- _beanHandle = ((EJBObject)_beanInstance).getHandle();
+ if (_beanInstance instanceof EJBObject) {
+ try {
+ _beanHandle = ((EJBObject) _beanInstance).getHandle();
}
- catch (java.rmi.RemoteException re)
- {
+ catch (java.rmi.RemoteException re) {
throw new ControlException("Unable to get bean instance from handle", re);
}
@@ -219,122 +192,93 @@
// provides an opportunity to reset cached state or release non-persisted
// resources associated with the instance.
//
- protected void releaseBeanInstance(boolean alreadyRemoved)
- {
+ protected void releaseBeanInstance(boolean alreadyRemoved) {
_beanInstance = null;
_beanHandle = null;
}
-
- protected javax.naming.Context getInitialContext() throws NamingException
- {
- if (_context == null)
- {
- //If naming context information is provided, then use that to create the initial context
- JNDIContextEnv env = (JNDIContextEnv)context.getControlPropertySet(JNDIContextEnv.class);
- String value = env.contextFactory();
- if (value != null && value.length() > 0)
- {
- Hashtable ht = new Hashtable();
- ht.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, value);
- value = env.providerURL();
- if (value != null && value.length() > 0)
- ht.put(javax.naming.Context.PROVIDER_URL, value);
- value = env.principal();
- if (value != null && value.length() > 0)
- ht.put(javax.naming.Context.SECURITY_PRINCIPAL, value);
- value = env.credentials();
- if (value != null && value.length() > 0)
- ht.put(javax.naming.Context.SECURITY_CREDENTIALS, value);
- _context = new InitialContext(ht);
- }
- else
- {
- _context = new InitialContext();
- }
+
+ protected javax.naming.Context getInitialContext() throws NamingException {
+ if (_context == null) {
+ //If naming context information is provided, then use that to create the initial context
+ JNDIContextEnv env = (JNDIContextEnv) context.getControlPropertySet(JNDIContextEnv.class);
+ String value = env.contextFactory();
+ if (value != null && value.length() > 0) {
+ Hashtable ht = new Hashtable();
+ ht.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, value);
+ value = env.providerURL();
+ if (value != null && value.length() > 0)
+ ht.put(javax.naming.Context.PROVIDER_URL, value);
+ value = env.principal();
+ if (value != null && value.length() > 0)
+ ht.put(javax.naming.Context.SECURITY_PRINCIPAL, value);
+ value = env.credentials();
+ if (value != null && value.length() > 0)
+ ht.put(javax.naming.Context.SECURITY_CREDENTIALS, value);
+ _context = new InitialContext(ht);
+ }
+ else {
+ _context = new InitialContext();
+ }
}
return _context;
}
- @EventHandler(field="resourceContext", eventSet=ResourceEvents.class, eventName="onAcquire")
- public void onAcquire()
- {
+ @EventHandler(field = "resourceContext", eventSet = ResourceEvents.class, eventName = "onAcquire")
+ public void onAcquire() {
// Compute the home instance cache lookup key. The Service URI must
// be taken into account because different services use different
// class loaders. The JNDI home must be taken into account because
// it is possible to be a remote client of the same bean type on two
// different providers.
//
- if (_homeInstance == null)
- {
+ if (_homeInstance == null) {
// If JNDI name is an URL using a JNDI protocol
- if (_jndiName.toLowerCase().startsWith(JNDI_GLOBAL_PREFIX))
- {
- URLConnection jndiConn = null;
- try
- {
- URL url = new URL(_jndiName);
- jndiConn = url.openConnection();
- _homeInstance = jndiConn.getContent();
- }
- catch (MalformedURLException mue)
- {
- throw new ControlException(_jndiName +
- " is not a valid JNDI URL", mue);
- }
- catch (IOException ioe)
- {
- throw new ControlException("Error during JNDI lookup from "+
- _jndiName, ioe);
- }
- finally
- {
- try { if (jndiConn != null) { /* jndiConn.disconnect();*/ } }
- catch (RuntimeException re) { throw re; }
- catch (Exception e)
- {
- }
- }
- }
- else
- {
- try
- {
+ if (_jndiName.toLowerCase().startsWith(JNDI_GLOBAL_PREFIX)) {
+
+ URLConnection jndiConn = null;
+ try {
+ URL url = new URL(_jndiName);
+ jndiConn = url.openConnection();
+ _homeInstance = jndiConn.getContent();
+ }
+ catch (MalformedURLException mue) {
+ throw new ControlException(_jndiName + " is not a valid JNDI URL", mue);
+ }
+ catch (IOException ioe) {
+ throw new ControlException("Error during JNDI lookup from " + _jndiName, ioe);
+ }
+ }
+ else {
+ try {
javax.naming.Context ctx = getInitialContext();
_homeInstance = ctx.lookup(_jndiName);
}
- catch (Exception ne)
- {
+ catch (Exception ne) {
throw new ControlException("Error during JNDI lookup from " + _jndiName, ne);
}
}
-
- if (!_homeInterface.isAssignableFrom(_homeInstance.getClass()))
- {
- throw new ControlException("JNDI lookup of " + _jndiName +
- " failed to return an instance of " +
- _homeInterface);
+
+ if (!_homeInterface.isAssignableFrom(_homeInstance.getClass())) {
+ throw new ControlException("JNDI lookup of " + _jndiName + " failed to return an instance of " + _homeInterface);
}
}
}
- @EventHandler(field="resourceContext", eventSet=ResourceEvents.class, eventName="onRelease")
- public void onRelease()
- {
+ @EventHandler(field = "resourceContext", eventSet = ResourceEvents.class, eventName = "onRelease")
+ public void onRelease() {
//
// If conversational, attempt to save the bean reference,
// else always release it if stateless or not persistable.
//
//if (context.getService().getConversationID() == null ||
- if (!saveBeanInstance())
- {
+ if (!saveBeanInstance()) {
releaseBeanInstance(false);
}
}
//@EventHandler(field="context", eventSet=LifeCycle.class, eventName="onReset")
- public void onReset()
- {
+ public void onReset() {
_lastException = null;
// other work in onRelease(), delivered prior to reset event
}
@@ -344,41 +288,33 @@
* Handles all extended interface methods (i.e. EJB home and remote
* interface invocation)
*/
- public Object invoke(Method m, Object[] args) throws Throwable
- {
+ public Object invoke(Method m, Object[] args) throws Throwable {
Object retval = null;
- if (isHomeMethod(m))
- {
- try
- {
+ if (isHomeMethod(m)) {
+ try {
retval = m.invoke(_homeInstance, args);
}
- catch (Exception e)
- {
+ catch (Exception e) {
Throwable t = e;
if (e instanceof InvocationTargetException)
- t = ((InvocationTargetException)e).getTargetException();
-
+ t = ((InvocationTargetException) e).getTargetException();
_lastException = t;
-
throw t;
}
// If the method was successful and returns an instance of
// the bean interface class, then reset the target instance.
- if (isSelectorMethod(m))
- {
+ if (isSelectorMethod(m)) {
releaseBeanInstance(false);
retval = beanNarrow(retval);
_beanInstance = retval;
}
-
return retval;
}
- else // is remote / bean interface
- {
+ // is remote / bean interface
+ else {
if (_beanInstance == null)
_beanInstance = resolveBeanInstance();
@@ -386,25 +322,20 @@
// type-specific resolve should throw an appropriate exception
// that is more specific. This is a safety net.
if (_beanInstance == null)
- {
throw new ControlException("Unable to resolve bean instance");
- }
- try
- {
+ try {
return m.invoke(_beanInstance, args);
}
- catch (Exception e)
- {
+ catch (Exception e) {
Throwable t = e;
if (e instanceof InvocationTargetException)
- t = ((InvocationTargetException)e).getTargetException();
+ t = ((InvocationTargetException) e).getTargetException();
_lastException = t;
throw t;
}
- finally
- {
+ finally {
// Handle remove method properly
if (isRemoveMethod(m))
releaseBeanInstance(true);
@@ -415,42 +346,41 @@
/**
* EJBControl.getEJBHomeInstance()
*/
- public Object getEJBHomeInstance()
- {
+ public Object getEJBHomeInstance() {
return _homeInstance;
}
/**
* EJBControl.getEJBBeanInstance()
*/
- public boolean hasEJBBeanInstance()
- {
+ public boolean hasEJBBeanInstance() {
return _beanInstance != null;
}
/**
* EJBControl.getEJBBeanInstance()
*/
- public Object getEJBBeanInstance()
- {
+ public Object getEJBBeanInstance() {
return _beanInstance;
}
/**
* EJBControl.getEJBException()
*/
- public Throwable getEJBException()
- {
+ public Throwable getEJBException() {
return _lastException;
}
- @Context ControlBeanContext context;
- @Context ResourceContext resourceContext;
+ @Context
+ ControlBeanContext context;
+
+ @Context
+ ResourceContext resourceContext;
- protected Class _controlInterface;
- protected Class _homeInterface;
- protected Class _beanInterface;
- protected int _beanType;
+ protected Class _controlInterface;
+ protected Class _homeInterface;
+ protected Class _beanInterface;
+ protected int _beanType;
protected String _jndiName;
protected Handle _beanHandle;
protected transient javax.naming.Context _context; // don't persist
Modified: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBInfo.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBInfo.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBInfo.java (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EJBInfo.java Wed Oct 5 11:01:26 2005
@@ -31,26 +31,38 @@
* static inner class to make this functionality accesible in both static
* and non-static contexts
*/
-public class EJBInfo
-{
+public class EJBInfo {
+
+ /**
+ * @deprecated Use the JavaBean getter / setter instead
+ */
public String _refName;
+
+ /**
+ * @deprecated Use the JavaBean getter / setter instead
+ */
public Class _homeInterface;
+
+ /**
+ * @deprecated Use the JavaBean getter / setter instead
+ */
public Class _beanInterface;
+
+ /**
+ * @deprecated Use the JavaBean getter / setter instead
+ */
public String _beanType;
- public boolean _isLocal;
- public String toString()
- {
- return "{refname=" + _refName + " home=" + _homeInterface.getName() + " remote=" + _beanInterface.getName() +
- " type=" + _beanType + " local=" + _isLocal + "}";
- }
+ /**
+ * @deprecated Use the JavaBean getter / setter instead
+ */
+ public boolean _isLocal;
/**
* Derives bean attributes from the control interface
*/
- public EJBInfo(Class controlInterface)
- {
- _refName = getEJBRefName( controlInterface );
+ public EJBInfo(Class controlInterface) {
+ _refName = getEJBRefName(controlInterface);
Class localHome = null;
Class localBean = null;
@@ -68,9 +80,8 @@
checkList.add(subintfs[i]);
HashMap derivesFrom = new HashMap();
- for (int i = 0; i < checkList.size(); i++)
- {
- Class intf = (Class)checkList.elementAt(i);
+ for (int i = 0; i < checkList.size(); i++) {
+ Class intf = (Class) checkList.elementAt(i);
if (javax.ejb.EJBHome.class.isAssignableFrom(intf))
remoteHome = intf;
@@ -80,17 +91,14 @@
remoteBean = intf;
else if (javax.ejb.EJBLocalObject.class.isAssignableFrom(intf))
localBean = intf;
- else
- {
+ else {
//
// If none of the above, add any new subinterfaces to
// the search list.
//
subintfs = intf.getInterfaces();
- for (int j = 0; j < subintfs.length; j++)
- {
- if (!checkList.contains(subintfs[j]))
- {
+ for (int j = 0; j < subintfs.length; j++) {
+ if (!checkList.contains(subintfs[j])) {
checkList.add(subintfs[j]);
derivesFrom.put(subintfs[j], intf);
}
@@ -101,51 +109,29 @@
//
// From the located methods, identify the home/bean interfaces.
//
- if (remoteHome != null)
- {
+ if (remoteHome != null) {
if (localHome != null)
- {
- throw new ControlException(controlInterface +
- " extends multiple EJB home interfaces.");
- }
+ throw new ControlException(controlInterface + " extends multiple EJB home interfaces.");
_homeInterface = getRoot(remoteHome, derivesFrom);
}
else if (localHome != null)
- {
_homeInterface = getRoot(localHome, derivesFrom);
- }
- else
- {
- throw new ControlException(controlInterface +
- " does not extend the EJBHome or EJBLocalHome interfaces");
- }
+ else throw new ControlException(controlInterface + " does not extend the EJBHome or EJBLocalHome interfaces");
- if (remoteBean != null)
- {
+ if (remoteBean != null) {
if (localBean != null)
- {
- throw new ControlException("Interface " + controlInterface +
- " extends multiple EJB object interfaces.");
- }
+ throw new ControlException("Interface " + controlInterface + " extends multiple EJB object interfaces.");
_beanInterface = getRoot(remoteBean, derivesFrom);
}
else if (localBean != null)
- {
_beanInterface = getRoot(localBean, derivesFrom);
- }
- else
- {
- throw new ControlException("Interface " + controlInterface +
- " does not extend the EJBObject or EJBLocalObject interfaces");
- }
+ else throw new ControlException("Interface " + controlInterface + " does not extend the EJBObject or EJBLocalObject interfaces");
// Identify the bean type via bean interface reflection
_beanType = "Session";
Method [] homeMethods = _homeInterface.getMethods();
- for (int i = 0; i < homeMethods.length; i++)
- {
- if (isFinderMethod(homeMethods[i]))
- {
+ for (int i = 0; i < homeMethods.length; i++) {
+ if (isFinderMethod(homeMethods[i])) {
_beanType = "Entity";
break;
}
@@ -158,36 +144,79 @@
* Unwinds the results of reflecting through the interface inheritance
* hierachy to find the original root class from a derived class
*/
- public Class getRoot(Class clazz, HashMap derivesFrom)
- {
- while (derivesFrom.containsKey(clazz))
- clazz = (Class)derivesFrom.get(clazz);
+ public Class getRoot(Class clazz, HashMap derivesFrom) {
+ while (derivesFrom.containsKey(clazz)) clazz = (Class) derivesFrom.get(clazz);
return clazz;
}
- static protected boolean isFinderMethod(Method m)
- {
+ /**
+ * Computes a unique local ejb ref name based upon the JCX class name
+ */
+ public static String getEJBRefName(Class jcxClass) {
+ return jcxClass.getName() + ".jcx";
+ }
+
+ public String getRefName() {
+ return _refName;
+ }
+
+ public void setRefName(String refName) {
+ _refName = refName;
+ }
+
+ public Class getHomeInterface() {
+ return _homeInterface;
+ }
+
+ public void setHomeInterface(Class homeInterface) {
+ _homeInterface = homeInterface;
+ }
+
+ public Class getBeanInterface() {
+ return _beanInterface;
+ }
+
+ public void setBeanInterface(Class beanInterface) {
+ _beanInterface = beanInterface;
+ }
+
+ public String getBeanType() {
+ return _beanType;
+ }
+
+ public void setBeanType(String beanType) {
+ _beanType = beanType;
+ }
+
+ public boolean isLocal() {
+ return _isLocal;
+ }
+
+ public void setLocal(boolean local) {
+ _isLocal = local;
+ }
+
+ public String toString() {
+ return
+ "{refname=" + _refName +
+ " home=" + _homeInterface.getName() +
+ " remote=" + _beanInterface.getName() +
+ " type=" + _beanType +
+ " local=" + _isLocal + "}";
+ }
+
+ protected static boolean isFinderMethod(Method m) {
if (!m.getName().startsWith("find")) // EJB enforced pattern
return false;
return methodThrows(m, FinderException.class);
}
- static protected boolean methodThrows(Method m, Class exceptionClass)
- {
+ protected static boolean methodThrows(Method m, Class exceptionClass) {
Class [] exceptions = m.getExceptionTypes();
for (int j = 0; j < exceptions.length; j++)
if (exceptionClass.isAssignableFrom(exceptions[j]))
return true;
return false;
}
-
- /**
- * Computes a unique local ejb ref name based upon the JCX class name
- */
- static public String getEJBRefName(Class jcxClass)
- {
- return jcxClass.getName() + ".jcx";
- }
-
}
Modified: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControl.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControl.java (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControl.java Wed Oct 5 11:01:26 2005
@@ -41,7 +41,8 @@
* <a href="../../../../guide/controls/ejb/navEJBControl.html">EJB Control</a>.
*/
@ControlInterface (defaultBinding="org.apache.beehive.controls.system.ejb.EntityEJBControlImpl")
-public interface EntityEJBControl extends EJBControl
+public interface EntityEJBControl
+ extends EJBControl
{
/**
* Supports iteration through a Collection of entity bean instances
Copied: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.java (from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.jcs)
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.java?p2=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.java&p1=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.jcs&r1=292004&r2=295058&rev=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.jcs (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/EntityEJBControlImpl.java Wed Oct 5 11:01:26 2005
@@ -33,66 +33,48 @@
* The EntityEJBControlImpl class is the control implementation class for
* Entity EJBs.
*/
-@ControlImplementation( assembler = EJBControlAssembler.class )
+@ControlImplementation(assembler = EJBControlAssembler.class)
public class EntityEJBControlImpl
extends EJBControlImpl
implements EntityEJBControl, java.io.Serializable {
-
- static final long serialVersionUID = 1L;
- public EntityEJBControlImpl()
- {
- super();
- }
+ static final long serialVersionUID = 1L;
//
// Implements auto-find semantics for entity beans
//
- protected Object resolveBeanInstance()
- {
- //
+ protected Object resolveBeanInstance() {
// Already resolved and cached
- //
if (_beanInstance != null)
return _beanInstance;
- //
// Attempt to resolve from a cached handle
- //
_beanInstance = resolveBeanInstanceFromHandle();
if (_beanInstance != null)
return _beanInstance;
- //
// Attempt to resolve bean instance from cached primary key
- //
if (_lastKey == null)
- throw new ControlException("Unable to locate a target bean instance, because a successful create or finder method has not been executed.");
+ throw new ControlException("Unable to locate a target bean instance, because a successful create or finder method has not been executed.");
- Class [] findArgType = new Class[] { _lastKey.getClass() };
- try
- {
- Method finder = _homeInterface.getMethod("findByPrimaryKey",
- findArgType);
- return finder.invoke(_homeInstance, new Object [] { _lastKey });
- }
- catch (NoSuchMethodException nsme)
- {
- throw new ControlException("Unable to locate findByPrimaryKey method on home interface",nsme);
+ Class [] findArgType = new Class[]{_lastKey.getClass()};
+ try {
+ Method finder = _homeInterface.getMethod("findByPrimaryKey", findArgType);
+ return finder.invoke(_homeInstance, new Object []{_lastKey});
+ }
+ catch (NoSuchMethodException nsme) {
+ throw new ControlException("Unable to locate findByPrimaryKey method on home interface", nsme);
}
- catch (InvocationTargetException ite)
- {
+ catch (InvocationTargetException ite) {
_lastException = ite.getTargetException();
- throw new ControlException("Failure to locate entity instance associated with the last primary key", _lastException);
+ throw new ControlException("Failure to locate entity instance associated with the last primary key", _lastException);
}
- catch (Exception e)
- {
- throw new ControlException("Unexpected exception in auto-find",e);
+ catch (Exception e) {
+ throw new ControlException("Unexpected exception in auto-find", e);
}
}
- protected boolean saveBeanInstance()
- {
+ protected boolean saveBeanInstance() {
//
// First, delegate to parent (handle-based persistence)
//
@@ -102,15 +84,13 @@
//
// Fall back to persistence using a saved primary key value
//
- try
- {
+ try {
if (_beanInstance instanceof EJBObject)
- _lastKey = (Serializable)((EJBObject)_beanInstance).getPrimaryKey();
+ _lastKey = (Serializable) ((EJBObject) _beanInstance).getPrimaryKey();
else
- _lastKey = (Serializable)((EJBLocalObject)_beanInstance).getPrimaryKey();
+ _lastKey = (Serializable) ((EJBLocalObject) _beanInstance).getPrimaryKey();
}
- catch (RemoteException re)
- {
+ catch (RemoteException re) {
throw new ControlException("Unable to save bean instance", re);
}
return true;
@@ -120,20 +100,15 @@
// Release the bean instance. Entity bean instances are *never* removed, except via
// direct client calls to the remove method.
//
- protected void releaseBeanInstance(boolean alreadyRemoved)
- {
+ protected void releaseBeanInstance(boolean alreadyRemoved) {
super.releaseBeanInstance(alreadyRemoved);
// Release any cached primary key value
_lastKey = null;
}
- private boolean isMultiSelectorMethod(Method m)
- {
- if (isFinderMethod(m) &&
- m.getReturnType().isAssignableFrom(Collection.class))
- return true;
- return false;
+ private boolean isMultiSelectorMethod(Method m) {
+ return isFinderMethod(m) && m.getReturnType().isAssignableFrom(Collection.class);
}
//
@@ -141,38 +116,29 @@
// work to maintain the primary key cache for methods which alter the
// target bean instance.
//
- public Object invoke(Method m, Object [] args) throws Throwable
- {
+ public Object invoke(Method m, Object [] args) throws Throwable {
Throwable invokeException = null;
Object retval = null;
Object currentBeanInstance = _beanInstance;
- try
- {
+ try {
retval = super.invoke(m, args);
}
- catch (Exception t)
- {
+ catch (Exception t) {
// a tasty treat, but I'll throw up later
invokeException = t;
}
- if (isMultiSelectorMethod(m))
- {
+ if (isMultiSelectorMethod(m)) {
releaseBeanInstance(false);
- Collection collection = (Collection)retval;
- if (collection != null && !collection.isEmpty())
- {
+ Collection collection = (Collection) retval;
+ if (collection != null && !collection.isEmpty()) {
_colIter = collection.iterator();
_beanInstance = beanNarrow(_colIter.next());
}
- else
- {
- releaseBeanInstance(false);
- }
+ else releaseBeanInstance(false);
}
- else if (isSelectorMethod(m))
- {
+ else if (isSelectorMethod(m)) {
// Release collection results if a single select method is called.
_colIter = null;
}
@@ -186,13 +152,11 @@
/**
* EntityEJBControl.getEJBNextBeanInstance()
*/
- public Object getEJBNextBeanInstance()
- {
+ public Object getEJBNextBeanInstance() {
if (_colIter == null)
return null;
- if (!_colIter.hasNext())
- {
+ if (!_colIter.hasNext()) {
releaseBeanInstance(false);
return null;
}
@@ -205,12 +169,10 @@
// Override the onCreate event handler that was already defined in EJBControlImpl to
// add additional processing.
//
- public void onCreate()
- {
+ public void onCreate() {
super.onCreate();
- if (_beanType != EJBControlImpl.ENTITY_BEAN)
- {
- throw new ControlException("Attempting to use a entity bean control with a bean that is not a entity bean");
+ if (_beanType != EJBControlImpl.ENTITY_BEAN) {
+ throw new ControlException("Attempting to use a entity bean control with a bean that is not a entity bean");
}
}
@@ -218,13 +180,12 @@
// Override the onReset event handler that was already defined in EJBControlImpl to
// add additional processing.
//
- public void onReset()
- {
+ public void onReset() {
super.onReset();
_lastKey = null;
_colIter = null;
}
private Serializable _lastKey; // primary key of the selected instance
- transient private Iterator _colIter; // multi-finder result iterator
+ private transient Iterator _colIter; // multi-finder result iterator
}
Modified: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControl.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControl.java (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControl.java Wed Oct 5 11:01:26 2005
@@ -41,6 +41,7 @@
* <a href="../../../../guide/controls/ejb/navEJBControl.html">EJB Control</a>.
*/
@ControlInterface (defaultBinding="org.apache.beehive.controls.system.ejb.SessionEJBControlImpl")
-public interface SessionEJBControl extends EJBControl
+public interface SessionEJBControl
+ extends EJBControl
{
}
Copied: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java (from r292004, beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.jcs)
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java?p2=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java&p1=beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.jcs&r1=292004&r2=295058&rev=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.jcs (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/SessionEJBControlImpl.java Wed Oct 5 11:01:26 2005
@@ -28,90 +28,74 @@
/**
* The SessionEJBControlImpl class is the control implementation class for
* Stateless/Stateful Session EJBs.
- *
+ * <p/>
* Currently, this is a noop since no session-bean specific control APIs
* are defined, but having a unique control interface/impl class still allows
* JellyBeans to create two different control types.
- *
*/
-@ControlImplementation( assembler = EJBControlAssembler.class )
+@ControlImplementation(assembler = EJBControlAssembler.class)
public class SessionEJBControlImpl
extends EJBControlImpl
- implements SessionEJBControl, java.io.Serializable
-{
+ implements SessionEJBControl, java.io.Serializable {
+
static final long serialVersionUID = 1L;
/**
* Override ejbControl.onCreate to perform additional processing
*/
- public void onCreate()
- {
+ public void onCreate() {
+
super.onCreate();
if (_beanType != EJBControlImpl.SESSION_BEAN)
- {
- throw new ControlException("Attempting to use a session bean control with a bean that is not a session bean");
- }
+ throw new ControlException("Attempting to use a session bean control with a bean that is not a session bean");
}
/**
* Implements auto-create semantics for Session beans.
*/
- protected Object resolveBeanInstance()
- {
- //
+ protected Object resolveBeanInstance() {
+
// First, try to resolve from a cached EJB handle (if any)
- //
Object fromHandle = resolveBeanInstanceFromHandle();
if (fromHandle != null)
- {
return fromHandle;
- }
- // Find null arg create() on the home interface, and use it to get
- // an instance
- try
- {
- // TODO: for efficiency, this could be done once per home
- // interface and cached.
- Method createMethod = _homeInterface.getMethod("create", new Class []{ });
- Object beanInstance = createMethod.invoke(_homeInstance, null);
+ // Find null arg create() on the home interface, and use it to get an instance
+ try {
+ /* todo: for efficiency, this could be done once per home interface and cached */
+ Method createMethod = _homeInterface.getMethod("create", new Class []{});
+ Object beanInstance = createMethod.invoke(_homeInstance, null);
_autoCreated = true;
return beanInstance;
}
- catch (NoSuchMethodException nsme)
- {
- throw new ControlException("Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters");
+ catch (NoSuchMethodException e) {
+ throw new ControlException("Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters");
}
- catch (InvocationTargetException ite)
- {
- _lastException = ite.getTargetException();
+ catch (InvocationTargetException e) {
+ _lastException = e.getTargetException();
- throw new ControlException("Unable to create session bean instance", _lastException);
+ throw new ControlException("Unable to create session bean instance", _lastException);
}
- catch (Exception e)
- {
- throw new ControlException("Unable to invoke home interface create method",e);
+ catch (Exception e) {
+ throw new ControlException("Unable to invoke home interface create method", e);
}
}
- protected void releaseBeanInstance(boolean alreadyRemoved)
- {
+ protected void releaseBeanInstance(boolean alreadyRemoved) {
//
// For session EJBs, releasing the instance implies the physical
// removal of the bean instance. If the bean was auto-created by
// the control, it has responsibility for deleting.
//
- if (_beanInstance != null && _autoCreated && !alreadyRemoved)
- {
- try
- {
+ if (_beanInstance != null && _autoCreated && !alreadyRemoved) {
+ try {
if (EJBObject.class.isAssignableFrom(_beanInterface))
- ((EJBObject)_beanInstance).remove();
+ ((EJBObject) _beanInstance).remove();
else
- ((EJBLocalObject)_beanInstance).remove();
+ ((EJBLocalObject) _beanInstance).remove();
}
- catch (Exception e) // RemoteException or REmoveException
- {
+ /* RemoteException or RemoveException */
+ catch (Exception e) {
_lastException = e;
}
}
@@ -123,5 +107,5 @@
* Set to true if the EJB instance was autocreated as a result of a bean method
* call (as opposed to direct invocation of the home create() method).
*/
- boolean _autoCreated = false;
+ private boolean _autoCreated = false;
}
Modified: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/EJBJarDescriptorHandler.java Wed Oct 5 11:01:26 2005
@@ -45,7 +45,7 @@
{
Element sessionBean = (Element)e;
- if (ejbInfo._isLocal) {
+ if (ejbInfo.isLocal()) {
insertEJBLocalRefInEJBJar(sessionBean, ejbInfo, ejbLinkValue, document);
}
else {
@@ -59,7 +59,7 @@
System.err.println("EJBControlAssembler.insertEJBRefInEJBJar() called");
System.err.println("ejbLinkValue =" + ejbLinkValue);
List ejbRefArray = DomUtils.getChildElementsByName(sessionBean, "ejb-ref");
- String insertedEjbRefName = ei._refName;
+ String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbRefArray.size() - 1; j >= 0; j--) {
@@ -85,15 +85,15 @@
insertedEjbRef.appendChild(ejbRefName);
Element ejbRefType = ejbDoc.createElement("ejb-ref-type");
- ejbRefType.setTextContent(ei._beanType);
+ ejbRefType.setTextContent(ei.getBeanType());
insertedEjbRef.appendChild(ejbRefType);
Element homeType = ejbDoc.createElement("home");
- homeType.setTextContent(ei._homeInterface.getName());
+ homeType.setTextContent(ei.getHomeInterface().getName());
insertedEjbRef.appendChild(homeType);
Element remoteType = ejbDoc.createElement("remote");
- remoteType.setTextContent(ei._beanInterface.getName());
+ remoteType.setTextContent(ei.getBeanInterface().getName());
insertedEjbRef.appendChild(remoteType);
Element ejbLink = ejbDoc.createElement("ejb-link");
@@ -106,7 +106,7 @@
System.err.println("EJBControlAssembler.insertEJBLocalRefInEJBJar() called");
System.err.println("ejbLinkValue =" + ejbLinkValue);
List ejbLocalRefArray = DomUtils.getChildElementsByName(sessionBean, "ejb-local-ref");
- String insertedEjbRefName = ei._refName;
+ String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbLocalRefArray.size() - 1; j >= 0; j--) {
@@ -133,15 +133,15 @@
insertedEjbLocalRef.appendChild(ejbRefName);
Element ejbRefType = ejbDoc.createElement("ejb-ref-type");
- ejbRefType.setTextContent(ei._beanType);
+ ejbRefType.setTextContent(ei.getBeanType());
insertedEjbLocalRef.appendChild(ejbRefType);
Element homeType = ejbDoc.createElement("local-home");
- homeType.setTextContent(ei._homeInterface.getName());
+ homeType.setTextContent(ei.getHomeInterface().getName());
insertedEjbLocalRef.appendChild(homeType);
Element localType = ejbDoc.createElement("local");
- localType.setTextContent(ei._beanInterface.getName());
+ localType.setTextContent(ei.getBeanInterface().getName());
insertedEjbLocalRef.appendChild(localType);
Element ejbLink = ejbDoc.createElement("ejb-link");
Modified: beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/WebDescriptorHandler.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/WebDescriptorHandler.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/WebDescriptorHandler.java (original)
+++ beehive/trunk/system-controls/src/ejb/org/apache/beehive/controls/system/ejb/internal/WebDescriptorHandler.java Wed Oct 5 11:01:26 2005
@@ -38,7 +38,7 @@
public void assemble(Document document, EJBInfo ejbInfo, String ejbLinkValue) {
Element webAppType = document.getDocumentElement();
- if (ejbInfo._isLocal)
+ if (ejbInfo.isLocal())
insertEJBLocalRefInWebApp(webAppType, ejbInfo, ejbLinkValue, document);
else
insertEJBRefInWebApp(webAppType, ejbInfo, ejbLinkValue, document);
@@ -50,7 +50,7 @@
List ejbRefArray = DomUtils.getChildElementsByName(webAppType, "ejb-ref");
- String insertedEjbRefName = ei._refName;
+ String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbRefArray.size() - 1; j >= 0; j--) {
Element ejbRef = (Element) ejbRefArray.get(j);
@@ -73,15 +73,15 @@
insertedEjbRef.appendChild(ejbRefName);
Element ejbRefType = webAppDoc.createElement("ejb-ref-type");
- ejbRefType.setTextContent(ei._beanType);
+ ejbRefType.setTextContent(ei.getBeanType());
insertedEjbRef.appendChild(ejbRefType);
Element homeType = webAppDoc.createElement("home");
- homeType.setTextContent(ei._homeInterface.getName());
+ homeType.setTextContent(ei.getBeanInterface().getName());
insertedEjbRef.appendChild(homeType);
Element remoteType = webAppDoc.createElement("remote");
- remoteType.setTextContent(ei._beanInterface.getName());
+ remoteType.setTextContent(ei.getBeanInterface().getName());
insertedEjbRef.appendChild(remoteType);
Element ejbLink = webAppDoc.createElement("ejb-link");
@@ -95,7 +95,7 @@
System.err.println("ejbLinkValue =" + ejbLinkValue);
List ejbLocalRefArray = DomUtils.getChildElementsByName(webAppType, "ejb-local-ref");
- String insertedEjbRefName = ei._refName;
+ String insertedEjbRefName = ei.getRefName();
Node nextSibling = null;
for (int j = ejbLocalRefArray.size() - 1; j >= 0; j--) {
@@ -119,15 +119,15 @@
insertedEjbLocalRef.appendChild(ejbRefName);
Element ejbRefType = webAppDoc.createElement("ejb-ref-type");
- ejbRefType.setTextContent(ei._beanType);
+ ejbRefType.setTextContent(ei.getBeanType());
insertedEjbLocalRef.appendChild(ejbRefType);
Element homeType = webAppDoc.createElement("local-home");
- homeType.setTextContent(ei._homeInterface.getName());
+ homeType.setTextContent(ei.getHomeInterface().getName());
insertedEjbLocalRef.appendChild(homeType);
Element localType = webAppDoc.createElement("local");
- localType.setTextContent(ei._beanInterface.getName());
+ localType.setTextContent(ei.getBeanInterface().getName());
insertedEjbLocalRef.appendChild(localType);
Element ejbLink = webAppDoc.createElement("ejb-link");
Modified: beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/JMSControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/JMSControl.java?rev=295058&r1=295057&r2=295058&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/JMSControl.java (original)
+++ beehive/trunk/system-controls/src/jms/org/apache/beehive/controls/system/jms/JMSControl.java Wed Oct 5 11:01:26 2005
@@ -17,18 +17,18 @@
*/
package org.apache.beehive.controls.system.jms;
-import java.util.Map;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
+import java.util.Map;
import javax.jms.Session;
import org.apache.beehive.controls.api.ControlException;
-import org.apache.beehive.controls.api.packaging.FeatureInfo;
import org.apache.beehive.controls.api.bean.AnnotationMemberTypes;
import org.apache.beehive.controls.api.bean.ControlInterface;
import org.apache.beehive.controls.api.bean.AnnotationConstraints;
+import org.apache.beehive.controls.api.packaging.FeatureInfo;
import org.apache.beehive.controls.api.properties.PropertySet;
/**