From: <st...@us...> - 2006-10-27 16:35:37
|
Revision: 3540 http://svn.sourceforge.net/smartfrog/?rev=3540&view=rev Author: steve_l Date: 2006-10-27 09:35:06 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Work on lifecycle notifications; moved some stuff in from deployapi Modified Paths: -------------- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/components.cdl trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpEventImpl.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpNotificationImpl.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/components.cdl trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/CdlJavaImpl.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/EchoImpl.java trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/Constants.java trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/dom/PropertyList.java trunk/core/extras/cdl/test/org/smartfrog/test/unit/sfcore/languages/cdl/generate/GenerateComponentsTest.java Added Paths: ----------- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompound.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompoundImpl.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleListener.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleStateEnum.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpCompoundImpl.java Removed Paths: ------------- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponent.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponentImpl.java trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpComponentImpl.java Deleted: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponent.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponent.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponent.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -1,30 +0,0 @@ -/** (C) Copyright 2006 Hewlett-Packard Development Company, LP - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - For more information: www.smartfrog.org - - */ -package org.smartfrog.services.cddlm.cdl.base; - -import java.rmi.Remote; - -/** - * created 01-Feb-2006 11:18:53 - */ - - -public interface CdlComponent extends Remote { -} Deleted: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponentImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponentImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponentImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -1,61 +0,0 @@ -/** (C) Copyright 2006 Hewlett-Packard Development Company, LP - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - For more information: www.smartfrog.org - - */ -package org.smartfrog.services.cddlm.cdl.base; - -import org.smartfrog.sfcore.compound.CompoundImpl; -import org.smartfrog.sfcore.common.SmartFrogException; -import org.smartfrog.sfcore.common.SmartFrogResolutionException; -import org.smartfrog.sfcore.reference.Reference; -import org.smartfrog.sfcore.reference.ReferencePart; - -import javax.xml.namespace.QName; -import java.rmi.RemoteException; - -/** - * created 01-Feb-2006 11:19:17 - */ - -public class CdlComponentImpl extends CompoundImpl implements CdlComponent { - public static final String ATTR_TEXT = "sfText"; - - public CdlComponentImpl() throws RemoteException { - } - - public synchronized void sfDeploy() throws SmartFrogException, - RemoteException { - super.sfDeploy(); - } - - public synchronized void sfStart() throws SmartFrogException, - RemoteException { - super.sfStart(); - } - - public Object resolve(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException { - Reference r = new Reference(name); - return sfResolve(r, mandatory); - } - - public String resolveText(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException { - Reference r = new Reference(name); - r.addElement(ReferencePart.attrib(ATTR_TEXT)); - return (String) sfResolve(r, mandatory); - } -} Copied: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompound.java (from rev 3497, trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponent.java) =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompound.java (rev 0) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompound.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -0,0 +1,83 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.cddlm.cdl.base; + +import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.sfcore.common.SmartFrogResolutionException; + +import javax.xml.namespace.QName; +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * created 01-Feb-2006 11:18:53 + */ + + +public interface CdlCompound extends Remote { + /** + * The name under which XML text gets added + * {@value} + */ + String ATTR_TEXT = "sfText"; + /** + * URL of an endpoint to notify + */ + /* + public String ATTR_NOTIFICATION_ENDPOINT = "endpoint"; + + public String ATTR_TIMEOUT = "timeout"; + + public String ATTR_IDENTIFIER = "identifier"; +*/ + String ATTR_JOBURI = "joburi"; + + /** + * Resolve a reference + * @param name qname of the reference + * @param mandatory flag to indicate a mandatory reference + * @return whatever resolved + * @throws org.smartfrog.sfcore.common.SmartFrogResolutionException for resolution problems + * @throws java.rmi.RemoteException for network problems + */ + Object resolve(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException; + + /** + * Resolve the sfText node under the named reference + * @param name qname of the reference + * @param mandatory flag to indicate a mandatory reference + * @return whatever resolved + * @throws org.smartfrog.sfcore.common.SmartFrogResolutionException for resolution problems + * @throws java.rmi.RemoteException for network problems + */ + String resolveText(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException; + + /** + * bind to something listening for lifecycle events. No events are raised at this point. + * + * @param uri job ID + * @throws org.smartfrog.sfcore.common.SmartFrogException + * @throws java.rmi.RemoteException + */ + void subscribe(String uri, LifecycleListener target) throws SmartFrogException, + RemoteException; + + LifecycleListener getListener() throws RemoteException; +} Property changes on: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompound.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompoundImpl.java (from rev 3497, trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlComponentImpl.java) =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompoundImpl.java (rev 0) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompoundImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -0,0 +1,173 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.cddlm.cdl.base; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.sfcore.common.SmartFrogResolutionException; +import org.smartfrog.sfcore.compound.CompoundImpl; +import org.smartfrog.sfcore.prim.TerminationRecord; +import org.smartfrog.sfcore.reference.Reference; +import org.smartfrog.sfcore.reference.ReferencePart; + +import javax.xml.namespace.QName; +import java.net.URI; +import java.net.URISyntaxException; +import java.rmi.RemoteException; + +/** + * Base component for CDL components. It is a compound, obviously. + * created 01-Feb-2006 11:19:17 + */ + +public class CdlCompoundImpl extends CompoundImpl + implements CdlCompound, LifecycleListener { + + private URI jobURI; + private static final Log log = LogFactory.getLog(CdlCompoundImpl.class); + private LifecycleListener listener; + + public CdlCompoundImpl() throws RemoteException { + } + + /** + * Deploy the compound. Deployment is defined as iterating over the context + * and deploying any parsed eager components. + * + * @throws org.smartfrog.sfcore.common.SmartFrogException + * failure deploying compound or + * sub-component + * @throws java.rmi.RemoteException In case of Remote/nework error + */ + public synchronized void sfDeploy() throws SmartFrogException, RemoteException { + super.sfDeploy(); + enterStateNotifying(LifecycleStateEnum.instantiated, null); + } + + /** + * Starts the compound. This sends a synchronous sfStart to all managed + * components in the compound context. Any failure will cause the compound + * to terminate + * + * @throws org.smartfrog.sfcore.common.SmartFrogException + * failed to start compound + * @throws java.rmi.RemoteException In case of Remote/nework error + */ + public synchronized void sfStart() throws SmartFrogException, RemoteException { + super.sfStart(); + enterStateNotifying(LifecycleStateEnum.running, null); + } + + + /** + * Performs the compound termination behaviour. Based on sfSyncTerminate + * flag this gets forwarded to sfSyncTerminate or sfASyncTerminateWith + * method. Terminates children before self. + * + * @param status termination status + */ + protected synchronized void sfTerminateWith(TerminationRecord status) { + super.sfTerminateWith(status); + try { + enterTerminatedStateNotifying(status); + } catch (RemoteException e) { + log.error(e); + } + } + /** + * Resolve a reference + * @param name qname of the reference + * @param mandatory flag to indicate a mandatory reference + * @return whatever resolved + * @throws SmartFrogResolutionException for resolution problems + * @throws RemoteException for network problems + */ + public Object resolve(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException { + Reference r = new Reference(name); + return sfResolve(r, mandatory); + } + + /** + * Resolve the sfText node under the named reference + * @param name qname of the reference + * @param mandatory flag to indicate a mandatory reference + * @return whatever resolved + * @throws SmartFrogResolutionException for resolution problems + * @throws RemoteException for network problems + */ + public String resolveText(QName name, boolean mandatory) throws SmartFrogResolutionException, RemoteException { + Reference r = new Reference(name); + r.addElement(ReferencePart.attrib(ATTR_TEXT)); + return (String) sfResolve(r, mandatory); + } + + /** + * bind to something listening for lifecycle events. No events are raised at this point. + * + * @param uri job ID + * @throws SmartFrogException + * @throws RemoteException + */ + public synchronized void subscribe(String uri, LifecycleListener target) throws SmartFrogException, + RemoteException { + try { + jobURI = new URI(uri); + } catch (URISyntaxException e) { + throw SmartFrogException.forward(e); + } + this.listener = target; + sfReplaceAttribute(ATTR_JOBURI, uri); + } + + + /** + * enter a state, send notification if this is different from a state we + * were in before This method is synchronous, you cannot enter a state till + * the last one was processed. + * <p/> + * If you try and enter the current state, then nothing happens + * + * @param newState new state to enter + * @param info string to record in the stateInfo field. + * @throws java.rmi.RemoteException for network problems + */ + public void enterStateNotifying(LifecycleStateEnum newState, String info) throws RemoteException { + if (listener != null) { + listener.enterStateNotifying(newState, info); + } + } + + /** + * terminate, send a message out + * + * @param record termination record + * @throws java.rmi.RemoteException for network problems + */ + public void enterTerminatedStateNotifying(TerminationRecord record) throws RemoteException { + if (listener != null) { + listener.enterTerminatedStateNotifying(record); + } + } + + public LifecycleListener getListener() { + return listener; + } +} Property changes on: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/CdlCompoundImpl.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleListener.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleListener.java (rev 0) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleListener.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -0,0 +1,58 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.cddlm.cdl.base; + +import org.smartfrog.sfcore.prim.TerminationRecord; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * Interface for things that want lifecycle events relayed + * created 27-Oct-2006 16:02:55 + */ + + +public interface LifecycleListener extends Remote { + + + /** + * enter a state, send notification if this is different from a state we + * were in before This method is synchronous, you cannot enter a state till + * the last one was processed. + * + * If you try and enter the current state, then nothing happens + * + * @param newState new state to enter + * @param info string to record in the stateInfo field. + * @throws java.rmi.RemoteException for network problems + */ + void enterStateNotifying(LifecycleStateEnum newState, + String info) throws RemoteException; + + /** + * terminate, send a message out + * + * @param record + * @throws java.rmi.RemoteException for network problems + */ + void enterTerminatedStateNotifying( + TerminationRecord record) throws RemoteException; +} Copied: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleStateEnum.java (from rev 3497, trunk/core/components/deployapi/src/org/smartfrog/services/deployapi/system/LifecycleStateEnum.java) =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleStateEnum.java (rev 0) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleStateEnum.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -0,0 +1,94 @@ +/** (C) Copyright 2005 Hewlett-Packard Development Company, LP + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ + +package org.smartfrog.services.cddlm.cdl.base; + +import org.smartfrog.sfcore.prim.Prim; + +import java.rmi.RemoteException; + +/** + * enumeration of lifecycle states. This type maps to the cmp: LifeCycleState, + * which is itself an extension of the Muws state. + */ +public enum LifecycleStateEnum { + undefined("UndefinedState"), + instantiated("InstantiatedState"), + initialized("InitializedState"), + running("RunningState"), + failed("FailedState"), + terminated("TerminatedState"); + public static final String STATE = "State"; + + LifecycleStateEnum(String textName) { + xmlName = textName; + } + + private final String xmlName; + + public static LifecycleStateEnum extract(String text) { + return valueOf(text); + } + + + public String getXmlName() { + return xmlName; + } + + + /** + * Returns the name of this enum constant, as contained in the declaration. + * This method may be overridden, though it typically isn't necessary or + * desirable. An enum type should override this method when a more + * "programmer-friendly" string form exists. + * + * @return the name of this enum constant + */ + public String toString() { + return xmlName; + } + + /** + * Infer the state of a prim + * @param prim, can be null + * @return the inferres state of the component + * @throws RemoteException if prim calls failed. + */ + public static LifecycleStateEnum infer(Prim prim) throws RemoteException { + if(prim==null) { + return undefined; + } + if(prim.sfIsTerminated()) { + return terminated; + } + if(prim.sfIsStarted()) { + return running; + } + if(prim.sfIsDeployed()) { + return initialized; + } + //anything else? Instantiated + return instantiated; + } + +} + + + Property changes on: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/LifecycleStateEnum.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/components.cdl =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/components.cdl 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/base/components.cdl 2006-10-27 16:35:06 UTC (rev 3540) @@ -38,7 +38,7 @@ <base:CdlComponent cdl:extends="base:Compound" > - <sfClass>org.smartfrog.services.cddlm.cdl.base.CdlComponentImpl</sfClass> + <sfClass>org.smartfrog.services.cddlm.cdl.base.CdlCompoundImpl</sfClass> </base:CdlComponent> Deleted: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpComponentImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpComponentImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpComponentImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -1,45 +0,0 @@ -/** (C) Copyright 2005 Hewlett-Packard Development Company, LP - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - For more information: www.smartfrog.org - - */ - - -package org.smartfrog.services.cddlm.cdl.cmp; - -import org.smartfrog.sfcore.common.SmartFrogException; -import org.smartfrog.sfcore.common.SmartFrogResolutionException; -import org.smartfrog.sfcore.compound.CompoundImpl; -import org.smartfrog.sfcore.reference.Reference; -import org.smartfrog.sfcore.reference.ReferencePart; -import org.smartfrog.services.cddlm.cdl.base.CdlComponentImpl; - -import javax.xml.namespace.QName; -import java.rmi.RemoteException; - -/** - * created 22-Jun-2005 13:14:43 - */ - -public class CmpComponentImpl extends CdlComponentImpl implements CmpComponent { - - - public CmpComponentImpl() throws RemoteException { - } - - -} Copied: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpCompoundImpl.java (from rev 3497, trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpComponentImpl.java) =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpCompoundImpl.java (rev 0) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpCompoundImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -0,0 +1,39 @@ +/** (C) Copyright 2005 Hewlett-Packard Development Company, LP + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ + + +package org.smartfrog.services.cddlm.cdl.cmp; + +import org.smartfrog.services.cddlm.cdl.base.CdlCompoundImpl; + +import java.rmi.RemoteException; + +/** + * created 22-Jun-2005 13:14:43 + */ + +public class CmpCompoundImpl extends CdlCompoundImpl implements CmpComponent { + + + public CmpCompoundImpl() throws RemoteException { + } + + +} Property changes on: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpCompoundImpl.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpEventImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpEventImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpEventImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -25,7 +25,7 @@ * created 23-Jun-2005 16:37:05 */ -public class CmpEventImpl extends CmpComponentImpl implements CmpEvent { +public class CmpEventImpl extends CmpCompoundImpl implements CmpEvent { public CmpEventImpl() throws RemoteException { } Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpNotificationImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpNotificationImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/CmpNotificationImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -25,7 +25,7 @@ * created 23-Jun-2005 16:38:41 */ -public class CmpNotificationImpl extends CmpComponentImpl +public class CmpNotificationImpl extends CmpCompoundImpl implements CmpNotification { public CmpNotificationImpl() throws RemoteException { Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/components.cdl =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/components.cdl 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/cmp/components.cdl 2006-10-27 16:35:06 UTC (rev 3540) @@ -16,7 +16,7 @@ <!--Not part of the spec: a cmp:component--> <cmp:Component > <sfClass sfi:type="trimmed" cdl:ref="cmp:CommandPath" /> - <cmp:CommandPath >org.smartfrog.services.cddlm.cdl.base.CdlComponentImpl</cmp:CommandPath> + <cmp:CommandPath >org.smartfrog.services.cddlm.cdl.base.CdlCompoundImpl</cmp:CommandPath> </cmp:Component> <!-- Events --> Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/CdlJavaImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/CdlJavaImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/CdlJavaImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -19,7 +19,7 @@ */ package org.smartfrog.services.cddlm.cdl.demo; -import org.smartfrog.services.cddlm.cdl.cmp.CmpComponentImpl; +import org.smartfrog.services.cddlm.cdl.cmp.CmpCompoundImpl; import org.smartfrog.sfcore.common.SmartFrogException; import java.rmi.RemoteException; @@ -28,7 +28,7 @@ * created 24-Jun-2005 14:01:08 */ -public class CdlJavaImpl extends CmpComponentImpl implements CdlJava { +public class CdlJavaImpl extends CmpCompoundImpl implements CdlJava { public CdlJavaImpl() throws RemoteException { } Modified: trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/EchoImpl.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/EchoImpl.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/services/cddlm/cdl/demo/EchoImpl.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -19,25 +19,25 @@ */ package org.smartfrog.services.cddlm.cdl.demo; -import org.smartfrog.services.cddlm.cdl.cmp.CmpComponentImpl; +import org.smartfrog.services.cddlm.cdl.cmp.CmpCompoundImpl; import org.smartfrog.sfcore.common.SmartFrogException; import org.smartfrog.sfcore.common.SmartFrogLivenessException; import org.smartfrog.sfcore.common.SmartFrogRuntimeException; -import org.smartfrog.sfcore.reference.Reference; import org.smartfrog.sfcore.logging.Log; import org.smartfrog.sfcore.prim.TerminationRecord; +import org.smartfrog.sfcore.reference.Reference; import org.smartfrog.sfcore.utils.ComponentHelper; import javax.swing.*; import javax.xml.namespace.QName; +import java.awt.*; import java.rmi.RemoteException; -import java.awt.*; /** * created 23-Jun-2005 17:52:13 */ -public class EchoImpl extends CmpComponentImpl implements Echo, Runnable { +public class EchoImpl extends CmpCompoundImpl implements Echo, Runnable { private Log log; public static QName QNAME_MESSAGE = new QName(Echo.DEMO_NAMESPACE, Echo.ATTR_MESSAGE); Modified: trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/Constants.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/Constants.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/Constants.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -163,10 +163,11 @@ /** * This is the default classname of anything, unless you say otherwise */ - public static final String CDL_COMPONENT_CLASSNAME = "org.smartfrog.services.cddlm.cdl.base.CdlComponentImpl"; + public static final String CDL_COMPONENT_CLASSNAME = "org.smartfrog.services.cddlm.cdl.base.CdlCompoundImpl"; /** our namespace node {@value} */ public static final QName QNAME_SMARTFROG_TYPES_NAMESPACE_ATTRIBUTE = new QName(XMLNS_SMARTFROG_TYPES, "namespace"); + } Modified: trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/dom/PropertyList.java =================================================================== --- trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/dom/PropertyList.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/dom/PropertyList.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -22,7 +22,7 @@ import nu.xom.Attribute; import nu.xom.Element; import nu.xom.Node; -import org.smartfrog.services.cddlm.cdl.cmp.CmpComponentImpl; +import org.smartfrog.services.cddlm.cdl.cmp.CmpCompoundImpl; import org.smartfrog.services.xml.java5.NamespaceUtils; import org.smartfrog.services.xml.utils.XsdUtils; import org.smartfrog.sfcore.common.SmartFrogCoreKeys; @@ -31,10 +31,10 @@ import org.smartfrog.sfcore.languages.cdl.Constants; import org.smartfrog.sfcore.languages.cdl.components.CdlComponentDescription; import org.smartfrog.sfcore.languages.cdl.components.CdlComponentDescriptionImpl; -import org.smartfrog.sfcore.languages.cdl.faults.CdlInvalidValueReferenceException; -import org.smartfrog.sfcore.languages.cdl.faults.CdlXmlParsingException; import org.smartfrog.sfcore.languages.cdl.faults.CdlException; +import org.smartfrog.sfcore.languages.cdl.faults.CdlInvalidValueReferenceException; import org.smartfrog.sfcore.languages.cdl.faults.CdlResolutionException; +import org.smartfrog.sfcore.languages.cdl.faults.CdlXmlParsingException; import org.smartfrog.sfcore.languages.cdl.generate.DescriptorSource; import org.smartfrog.sfcore.languages.cdl.generate.TypeMapper; import org.smartfrog.sfcore.languages.cdl.references.ReferencePath; @@ -48,8 +48,6 @@ import javax.xml.namespace.QName; import java.rmi.RemoteException; -import java.util.List; -import java.util.ArrayList; /** * This represents a template in the CDL @@ -501,7 +499,7 @@ //only do the text if there were no children if(text!=null && (Constants.POLICY_ALWAYS_EXPORT_TEXT_NODES || exported>0)) { - description.sfReplaceAttribute(CmpComponentImpl.ATTR_TEXT,text); + description.sfReplaceAttribute(CmpCompoundImpl.ATTR_TEXT,text); } } } Modified: trunk/core/extras/cdl/test/org/smartfrog/test/unit/sfcore/languages/cdl/generate/GenerateComponentsTest.java =================================================================== --- trunk/core/extras/cdl/test/org/smartfrog/test/unit/sfcore/languages/cdl/generate/GenerateComponentsTest.java 2006-10-27 16:28:08 UTC (rev 3539) +++ trunk/core/extras/cdl/test/org/smartfrog/test/unit/sfcore/languages/cdl/generate/GenerateComponentsTest.java 2006-10-27 16:35:06 UTC (rev 3540) @@ -19,16 +19,15 @@ */ package org.smartfrog.test.unit.sfcore.languages.cdl.generate; -import junit.framework.TestCase; -import org.smartfrog.test.system.sfcore.languages.cdl.execute.CdlComponentTest; -import org.smartfrog.test.system.sfcore.languages.cdl.execute.CdlExecTest; -import org.smartfrog.test.SmartFrogTestBase; -import org.smartfrog.sfcore.parser.Phases; +import org.smartfrog.services.cddlm.cdl.base.CdlCompoundImpl; +import org.smartfrog.services.cddlm.cdl.demo.EchoImpl; +import org.smartfrog.sfcore.common.SmartFrogCoreKeys; import org.smartfrog.sfcore.componentdescription.ComponentDescription; import org.smartfrog.sfcore.languages.cdl.components.CdlComponentDescription; -import org.smartfrog.sfcore.common.SmartFrogCoreKeys; -import org.smartfrog.services.cddlm.cdl.demo.EchoImpl; -import org.smartfrog.services.cddlm.cdl.base.CdlComponentImpl; +import org.smartfrog.sfcore.parser.Phases; +import org.smartfrog.test.SmartFrogTestBase; +import org.smartfrog.test.system.sfcore.languages.cdl.execute.CdlComponentTest; +import org.smartfrog.test.system.sfcore.languages.cdl.execute.CdlExecTest; /** * Use the CDL Files of the things that get deployed, and make some unit test @@ -54,7 +53,7 @@ ComponentDescription rootCD = phases.sfAsComponentDescription(); CdlComponentDescription rootCDL = (CdlComponentDescription) rootCD; String sfClass = rootCDL.sfResolve(SmartFrogCoreKeys.SF_CLASS, "", true); - assertEquals(CdlComponentImpl.class.getName(), sfClass); + assertEquals(CdlCompoundImpl.class.getName(), sfClass); } public void testEchoSfClassCorrect() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |