Return-Path: Delivered-To: apmail-incubator-river-commits-archive@minotaur.apache.org Received: (qmail 35511 invoked from network); 9 Nov 2010 06:33:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Nov 2010 06:33:30 -0000 Received: (qmail 56891 invoked by uid 500); 9 Nov 2010 06:34:02 -0000 Delivered-To: apmail-incubator-river-commits-archive@incubator.apache.org Received: (qmail 56827 invoked by uid 500); 9 Nov 2010 06:33:59 -0000 Mailing-List: contact river-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: river-dev@incubator.apache.org Delivered-To: mailing list river-commits@incubator.apache.org Received: (qmail 56810 invoked by uid 99); 9 Nov 2010 06:33:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Nov 2010 06:33:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Nov 2010 06:33:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A934C23888EA; Tue, 9 Nov 2010 06:32:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1032867 [1/2] - in /incubator/river/jtsk/skunk/surrogate: ./ nbproject/ nbproject/private/ refdocs/ src/ src/net/ src/net/jini/ src/net/jini/surrogate/ src/org/ src/org/apache/ src/org/apache/river/ src/org/apache/river/container/ src/org/... Date: Tue, 09 Nov 2010 06:32:32 -0000 To: river-commits@incubator.apache.org From: gtrasuk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101109063233.A934C23888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtrasuk Date: Tue Nov 9 06:32:31 2010 New Revision: 1032867 URL: http://svn.apache.org/viewvc?rev=1032867&view=rev Log: Files for initial commit. Added: incubator/river/jtsk/skunk/surrogate/build.xml incubator/river/jtsk/skunk/surrogate/manifest.mf incubator/river/jtsk/skunk/surrogate/nbproject/ incubator/river/jtsk/skunk/surrogate/nbproject/build-impl.xml incubator/river/jtsk/skunk/surrogate/nbproject/genfiles.properties incubator/river/jtsk/skunk/surrogate/nbproject/private/ incubator/river/jtsk/skunk/surrogate/nbproject/private/config.properties incubator/river/jtsk/skunk/surrogate/nbproject/private/private.properties incubator/river/jtsk/skunk/surrogate/nbproject/private/private.xml incubator/river/jtsk/skunk/surrogate/nbproject/project.properties incubator/river/jtsk/skunk/surrogate/nbproject/project.xml incubator/river/jtsk/skunk/surrogate/refdocs/ incubator/river/jtsk/skunk/surrogate/refdocs/sa-ip.pdf (with props) incubator/river/jtsk/skunk/surrogate/refdocs/sa.pdf incubator/river/jtsk/skunk/surrogate/src/ incubator/river/jtsk/skunk/surrogate/src/net/ incubator/river/jtsk/skunk/surrogate/src/net/jini/ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/DeactivationListener.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/GetCodebase.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/HostContext.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveHandler.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveManagement.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/Surrogate.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateController.java incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateCreationException.java incubator/river/jtsk/skunk/surrogate/src/org/ incubator/river/jtsk/skunk/surrogate/src/org/apache/ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ApplicationEnvironment.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStore.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStoreImpl.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/Host.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/JarFilter.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/Names.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/SettableCodebaseClassLoader.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/SurrogateInstaller.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/ClassInfo.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/Controller.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/Evaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/Initial.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/InvokeEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/InvokeVoidEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/ListEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/NopEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/OnEntry.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/OnExit.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/Retained.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/RootState.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/SetFieldEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/State.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateEventEvaluator.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachine.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineFactory.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineInvocationHandler.java incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/SubstateInfo.java incubator/river/jtsk/skunk/surrogate/test/ incubator/river/jtsk/skunk/surrogate/test/org/ incubator/river/jtsk/skunk/surrogate/test/org/apache/ incubator/river/jtsk/skunk/surrogate/test/org/apache/river/ incubator/river/jtsk/skunk/surrogate/test/org/apache/river/container/ incubator/river/jtsk/skunk/surrogate/test/org/apache/river/container/hsm/ incubator/river/jtsk/skunk/surrogate/test/org/apache/river/container/hsm/TestSM.java incubator/river/jtsk/skunk/surrogate/test/org/apache/river/container/hsm/TestSMInterface.java incubator/river/jtsk/skunk/surrogate/test/org/apache/river/container/hsm/TestSimpleMachine.java incubator/river/jtsk/skunk/surrogate/test/org/apache/river/surrogate/ incubator/river/jtsk/skunk/surrogate/test/org/apache/river/surrogate/SurrogateContextTest.java Added: incubator/river/jtsk/skunk/surrogate/build.xml URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/build.xml?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/build.xml (added) +++ incubator/river/jtsk/skunk/surrogate/build.xml Tue Nov 9 06:32:31 2010 @@ -0,0 +1,74 @@ + + + + + + + + + + + Builds, tests, and runs the project RiverSurrogate. + + + Added: incubator/river/jtsk/skunk/surrogate/manifest.mf URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/manifest.mf?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/manifest.mf (added) +++ incubator/river/jtsk/skunk/surrogate/manifest.mf Tue Nov 9 06:32:31 2010 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + Added: incubator/river/jtsk/skunk/surrogate/nbproject/build-impl.xml URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/build-impl.xml?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/build-impl.xml (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/build-impl.xml Tue Nov 9 06:32:31 2010 @@ -0,0 +1,891 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: incubator/river/jtsk/skunk/surrogate/nbproject/genfiles.properties URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/genfiles.properties?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/genfiles.properties (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/genfiles.properties Tue Nov 9 06:32:31 2010 @@ -0,0 +1,8 @@ +build.xml.data.CRC32=8d037bdc +build.xml.script.CRC32=8dea2037 +build.xml.stylesheet.CRC32=28e38971@1.38.2.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=8d037bdc +nbproject/build-impl.xml.script.CRC32=c1294c37 +nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45 Added: incubator/river/jtsk/skunk/surrogate/nbproject/private/config.properties URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/private/config.properties?rev=1032867&view=auto ============================================================================== (empty) Added: incubator/river/jtsk/skunk/surrogate/nbproject/private/private.properties URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/private/private.properties?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/private/private.properties (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/private/private.properties Tue Nov 9 06:32:31 2010 @@ -0,0 +1,6 @@ +compile.on.save=true +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=/home/trasukg/.netbeans/6.9/build.properties Added: incubator/river/jtsk/skunk/surrogate/nbproject/private/private.xml URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/private/private.xml?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/private/private.xml (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/private/private.xml Tue Nov 9 06:32:31 2010 @@ -0,0 +1,4 @@ + + + + Added: incubator/river/jtsk/skunk/surrogate/nbproject/project.properties URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/project.properties?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/project.properties (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/project.properties Tue Nov 9 06:32:31 2010 @@ -0,0 +1,83 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=surrogate +application.vendor=trasukg +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/RiverSurrogate.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${libs.ApacheRiverPlatform.classpath}:\ + ${libs.ApacheRiverLib.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit_4.classpath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=defaut +jnlp.offline-allowed=false +jnlp.signed=false +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +project.license=apache20 +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test Added: incubator/river/jtsk/skunk/surrogate/nbproject/project.xml URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/nbproject/project.xml?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/nbproject/project.xml (added) +++ incubator/river/jtsk/skunk/surrogate/nbproject/project.xml Tue Nov 9 06:32:31 2010 @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + RiverSurrogate + + + + + + + + + Added: incubator/river/jtsk/skunk/surrogate/refdocs/sa-ip.pdf URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/refdocs/sa-ip.pdf?rev=1032867&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/river/jtsk/skunk/surrogate/refdocs/sa-ip.pdf ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: incubator/river/jtsk/skunk/surrogate/refdocs/sa.pdf URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/refdocs/sa.pdf?rev=1032867&view=auto ============================================================================== Files incubator/river/jtsk/skunk/surrogate/refdocs/sa.pdf (added) and incubator/river/jtsk/skunk/surrogate/refdocs/sa.pdf Tue Nov 9 06:32:31 2010 differ Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/DeactivationListener.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/DeactivationListener.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/DeactivationListener.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/DeactivationListener.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + * Listener for surrogate deactivation as per SA2.4.4 + * @author trasukg + */ +public interface DeactivationListener { + /** Called by the surrogate host after the child surrogate's + * deactivate() method has been called. Must return in a + * timely fashion. + */ + public void deactivated(); +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/GetCodebase.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/GetCodebase.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/GetCodebase.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/GetCodebase.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + * Interface for surrogate to supply codebase as per SA2.4.2 + * + * @author trasukg + */ +public interface GetCodebase { + java.net.URL[] getCodebase(HostContext hostContext, Object context) + throws Exception; + +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/HostContext.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/HostContext.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/HostContext.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/HostContext.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +import java.io.InputStream; +import net.jini.discovery.DiscoveryManagement; + +/** + * Host Context as per SA2.4.3 + * @author trasukg + */ +public interface HostContext { + DiscoveryManagement getDiscoveryManager(); + + /** + * Inform the surrogate host that the surrogate must be + * deactivated. An active surrogate calls this interface at + * any time to request that it be removed from the surrogate + * host. The surrogate host then asynchronously calls the surrogate's + * deactivate() method. + */ + void cancelActivation(); + + SurrogateController newSurrogate(InputStream surrogate, + Object context, + DeactivationListener listener) + throws SurrogateCreationException; +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveHandler.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveHandler.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveHandler.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveHandler.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.jini.surrogate; + +/** + * KeepAliveHandler as per SA2.4.8 + * @author trasukg + */ +public interface KeepAliveHandler { + /** + * The keepAlive method is called periodically. The surrogate + * should use this call to perform operations related to liveness. + * @param period The maximum of time in milliseconds that elapses + * before the keepAlive method is called again. The period may + * change from call to call. + * + * The period value can be used to inform the device how much time + * might elapse before the surrogate checks back again. + * @throws Exception + */ + void keepAlive(long period) throws Exception; +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveManagement.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveManagement.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveManagement.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/KeepAliveManagement.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + * KeepAliveManagement interface as per SA2.4.7 + * If the interconnect specification that the context parameter + * implement the KeepAliveManagement interface, then an object that + * implements KeepAliveManagement is passed to the surrogate as its + * interconnect context. A surrogate for that interconnect should use + * the KeepAliveManagement interface to set a keep-alive handler, + * which will be called periodically so the handler can perform + * liveness-related work, including communicating with the device. + * @author trasukg + */ +public interface KeepAliveManagement { + void setKeepAliveHandler(KeepAliveHandler handler); +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/Surrogate.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/Surrogate.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/Surrogate.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/Surrogate.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + * Surrogate interface as per SA2.4.1 + * @author trasukg + */ +public interface Surrogate { + void activate(HostContext hostContext, Object context) + throws Exception; + void deactivate(); +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateController.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateController.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateController.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateController.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + * SurrogateController as per SA2.4.5 + * Allows a parent surrogate to deactivate a child surrogate. + * @author trasukg + */ +public interface SurrogateController { + /** + * Requests that the surrogate host deactivates the child + * surrogate this controller represents. Returns immediately + * upon making the request. + */ + public void deactivate(); +} Added: incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateCreationException.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateCreationException.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateCreationException.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/net/jini/surrogate/SurrogateCreationException.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.jini.surrogate; + +/** + *

+ * Exception to be thrown from newSurrogate() method in case + * of any failure to initialize the surrogate. + *

+ * + *

+ * This exception is as specified in SA2.4.6, with the following + * changes: The getMessage() and getNestedException() methods are + * left out, since they are no longer necessary, since the chained + * exception mechanism was added to JDK1.4 (one suspects the surrogate + * spec was written in JDK1.3 days). + *

+ * + *

+ * TODO: The serialized form listed in SA2.4.9 is no longer correct, + * because of the above-mentioned changes. The specification might need + * to be updated, unless we find that there are existing surrogate + * implementations. + *

+ * + * @author trasukg + */ +public class SurrogateCreationException extends Exception { + + public SurrogateCreationException(String message, Throwable cause) { + super(message, cause); + } + + public SurrogateCreationException(String message) { + super(message); + } + + +} Added: incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AbstractConnector.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.river.container; + +import java.io.File; +import java.net.URL; + +/** + * Defines an abstract connector for the surrogate container. + * The connector looks after discovering the device that needs the surrogate, + * then loads up the surrogate's jar file and installs the surrogate into the + * container. + * @author trasukg + */ +public class AbstractConnector { + + Host host=null; + + /** + * Process the surrogate device's request to host a surrogate, starting + * from a URL to the surrogate package. + */ + public void processSurrogateHostingRequest(URL surrogatePackage) { + // Allocate a working directory + File workingDir=host.newWorkDirectory(); + // TODO: Unpack the surrogate jar into the working directory + SurrogateInstaller installer= (SurrogateInstaller) + host.getAttribute(Names.SURROGATE_INSTALLER); + + installer.installSurrogate(host, workingDir); + } +} Added: incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ApplicationEnvironment.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ApplicationEnvironment.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ApplicationEnvironment.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/ApplicationEnvironment.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,36 @@ +/* + * Copyright 2010 trasukg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * under the License. + */ + +package org.apache.river.container; + +/** + * Everything the host needs to know about the surrogate. + * @author trasukg + */ +public class ApplicationEnvironment { + + SettableCodebaseClassLoader classLoader=null; + + public SettableCodebaseClassLoader getClassLoader() { + return classLoader; + } + + public void setClassLoader(SettableCodebaseClassLoader classLoader) { + this.classLoader = classLoader; + } + +} Added: incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStore.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStore.java?rev=1032867&view=auto ============================================================================== --- incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStore.java (added) +++ incubator/river/jtsk/skunk/surrogate/src/org/apache/river/container/AttributeStore.java Tue Nov 9 06:32:31 2010 @@ -0,0 +1,42 @@ +/* + * Copyright 2010 trasukg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * under the License. + */ + +package org.apache.river.container; + +/** + Implements an attribute store with some features of an IOC container, plus + some security visibility features. + * @author trasukg + */ +public interface AttributeStore { + /** + Return the attribute listed under the desired name, assuming that + the current code has permission to access that attribute. + + @param name + @return The attribute. + */ + public Object getAttribute(String name); + + /** + Store an attribute in the attribute store. + + @param name + @param attribute + */ + public void setAttribute(String name, Object attribute); +}