Update of /cvsroot/smartfrog/core/components/www/src/org/smartfrog/services/www/dbc
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23113/components/www/src/org/smartfrog/services/www/dbc
Modified Files:
DeployByCopyServerImpl.java
Log Message:
1. special ParentHelper class to do child management.
2. classpath stuff. This is not yet ready for use, ignore it!
3. getting deploy by copy and jboss deploy to work, these are tweaks made in the process
Index: DeployByCopyServerImpl.java
===================================================================
RCS file: /cvsroot/smartfrog/core/components/www/src/org/smartfrog/services/www/dbc/DeployByCopyServerImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DeployByCopyServerImpl.java 19 Jun 2006 16:25:15 -0000 1.1
--- DeployByCopyServerImpl.java 20 Jun 2006 20:28:13 -0000 1.2
***************
*** 26,29 ****
--- 26,30 ----
import org.smartfrog.sfcore.common.SmartFrogException;
import org.smartfrog.sfcore.common.SmartFrogLivenessException;
+ import org.smartfrog.sfcore.common.SmartFrogRuntimeException;
import org.smartfrog.sfcore.componentdescription.ComponentDescription;
import org.smartfrog.sfcore.logging.LogFactory;
***************
*** 31,35 ****
--- 32,39 ----
import org.smartfrog.sfcore.prim.PrimImpl;
import org.smartfrog.sfcore.prim.TerminationRecord;
+ import org.smartfrog.sfcore.prim.ChildMinder;
+ import org.smartfrog.sfcore.prim.Liveness;
import org.smartfrog.sfcore.utils.ComponentHelper;
+ import org.smartfrog.sfcore.utils.ParentHelper;
import java.io.File;
***************
*** 37,40 ****
--- 41,45 ----
import java.util.ArrayList;
import java.util.List;
+ import java.util.Enumeration;
/**
***************
*** 42,46 ****
*/
! public class DeployByCopyServerImpl extends PrimImpl implements DeployByCopyServer, Runnable {
private List filesToCopy = new ArrayList();
--- 47,52 ----
*/
! public class DeployByCopyServerImpl extends PrimImpl implements DeployByCopyServer, Runnable,
! ChildMinder {
private List filesToCopy = new ArrayList();
***************
*** 51,54 ****
--- 57,61 ----
private Prim shutdownPrim;
private ComponentHelper helper;
+ private ParentHelper childminder;
private Thread thread;
private Throwable caughtException;
***************
*** 65,78 ****
super.sfStart();
helper = new ComponentHelper(this);
//bind to and create the destination directory
destDir = new File(FileSystem.lookupAbsolutePath(this, ATTR_DEPLOY_DIR,
null, null, false, null));
! destDir.getParentFile().mkdirs();
//resolve deploy and start the startup prim
startup = sfResolve(ATTR_START_COMPONENT, startup, false);
if (startup != null) {
! startupPrim = helper.deployComponentDescription(ATTR_START_COMPONENT,
this,
startup,
--- 72,86 ----
super.sfStart();
helper = new ComponentHelper(this);
+ childminder = new ParentHelper(this);
//bind to and create the destination directory
destDir = new File(FileSystem.lookupAbsolutePath(this, ATTR_DEPLOY_DIR,
null, null, false, null));
! destDir.mkdirs();
//resolve deploy and start the startup prim
startup = sfResolve(ATTR_START_COMPONENT, startup, false);
if (startup != null) {
! startupPrim = childminder.deployComponentDescription(ATTR_START_COMPONENT,
this,
startup,
***************
*** 86,90 ****
shutdown = sfResolve(ATTR_SHUTDOWN_COMPONENT, shutdown, false);
if (shutdown != null) {
! shutdownPrim = helper.deployComponentDescription(ATTR_SHUTDOWN_COMPONENT,
this,
shutdown,
--- 94,98 ----
shutdown = sfResolve(ATTR_SHUTDOWN_COMPONENT, shutdown, false);
if (shutdown != null) {
! shutdownPrim = childminder.deployComponentDescription(ATTR_SHUTDOWN_COMPONENT,
this,
shutdown,
***************
*** 180,183 ****
--- 188,240 ----
/**
+ * Add a child.
+ *
+ * @param child child to add
+ *
+ * @throws java.rmi.RemoteException In case of Remote/nework error
+ */
+ public void sfAddChild(Liveness child) throws RemoteException {
+ childminder.sfAddChild(child);
+ }
+
+ /**
+ * Remove a child.
+ *
+ * @param child child to add
+ *
+ * @return Status of child removal
+ *
+ * @throws java.rmi.RemoteException In case of Remote/nework error
+ */
+ public boolean sfRemoveChild(Liveness child)
+ throws SmartFrogRuntimeException, RemoteException {
+ return childminder.sfRemoveChild(child);
+ }
+
+ /**
+ * Request whether implementor contains a given child.
+ *
+ * @param child child to check for
+ *
+ * @return true is child is present else false
+ *
+ * @throws java.rmi.RemoteException In case of Remote/nework error
+ */
+ public boolean sfContainsChild(Liveness child) throws RemoteException {
+ return childminder.sfContainsChild(child);
+ }
+
+ /**
+ * Gets an enumeration over the children of the implementor.
+ *
+ * @return enumeration over children
+ *
+ * @throws java.rmi.RemoteException In case of Remote/nework error
+ */
+ public Enumeration sfChildren() throws RemoteException {
+ return childminder.sfChildren();
+ }
+
+ /**
* Start the component in a new thread. Synchronized.
*
|