You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by gt...@apache.org on 2014/02/18 04:06:48 UTC
[2/7] git commit: There is now an Ideas page in river-container that
describes the concepts of the plugin. The river-container-maven-plugin
project has a 'listApps' goal that one can install and then print out the
configured container home.
There is now an Ideas page in river-container that describes the concepts of the plugin.
The river-container-maven-plugin project has a 'listApps' goal that one can install and then print out the configured container home.
Project: http://git-wip-us.apache.org/repos/asf/river-container/repo
Commit: http://git-wip-us.apache.org/repos/asf/river-container/commit/3b5a40ff
Tree: http://git-wip-us.apache.org/repos/asf/river-container/tree/3b5a40ff
Diff: http://git-wip-us.apache.org/repos/asf/river-container/diff/3b5a40ff
Branch: refs/heads/plugin-work
Commit: 3b5a40ff841c6b1b4389e09b18d5371bab267eaa
Parents: 2cbf9f2
Author: Greg Trasuk <tr...@trasuk.com>
Authored: Mon Jan 20 00:50:01 2014 -0500
Committer: Greg Trasuk <tr...@trasuk.com>
Committed: Mon Jan 20 00:50:01 2014 -0500
----------------------------------------------------------------------
river-container-maven-plugin/pom.xml | 2 +-
.../river/container/mvnplugin/ListAppsMojo.java | 57 +++++++++++++
.../river/container/mvnplugin/MyMojo.java | 84 --------------------
src/site/markdown/Ideas.md | 69 ++++++++++++++++
src/site/markdown/index.md | 5 ++
5 files changed, 132 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/river-container/blob/3b5a40ff/river-container-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/river-container-maven-plugin/pom.xml b/river-container-maven-plugin/pom.xml
index 161fe36..9bc4b1c 100644
--- a/river-container-maven-plugin/pom.xml
+++ b/river-container-maven-plugin/pom.xml
@@ -69,7 +69,7 @@
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<configuration>
- <goalPrefix>river-container-maven-plugin</goalPrefix>
+ <goalPrefix>river</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
http://git-wip-us.apache.org/repos/asf/river-container/blob/3b5a40ff/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/ListAppsMojo.java
----------------------------------------------------------------------
diff --git a/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/ListAppsMojo.java b/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/ListAppsMojo.java
new file mode 100644
index 0000000..6cdd294
--- /dev/null
+++ b/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/ListAppsMojo.java
@@ -0,0 +1,57 @@
+package org.apache.river.container.mvnplugin;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ *
+ *
+ */
+@Mojo( name = "listApps", requiresDirectInvocation=true, requiresProject=false)
+public class ListAppsMojo
+ extends AbstractMojo
+{
+ /**
+ * Location of the file.
+ */
+ @Parameter( property = "river.container.home", required = true )
+ private File containerHome;
+
+ /**
+ * Uses the client admin listApps script to list the applications that are
+ * in the currently running container.
+ * @throws MojoExecutionException
+ */
+ @Override
+ public void execute()
+ throws MojoExecutionException
+ {
+ System.out.println("Container home is " + containerHome.getAbsolutePath());
+ }
+}
http://git-wip-us.apache.org/repos/asf/river-container/blob/3b5a40ff/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/MyMojo.java
----------------------------------------------------------------------
diff --git a/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/MyMojo.java b/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/MyMojo.java
deleted file mode 100644
index 6a00263..0000000
--- a/river-container-maven-plugin/src/main/java/org/apache/river/container/mvnplugin/MyMojo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.apache.river.container.mvnplugin;
-
-/*
- * Copyright 2001-2005 The Apache Software Foundation.
- *
- * 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.
- */
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/**
- * Goal which touches a timestamp file.
- *
- * @deprecated Don't use!
- */
-@Mojo( name = "touch", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
-public class MyMojo
- extends AbstractMojo
-{
- /**
- * Location of the file.
- */
- @Parameter( defaultValue = "${project.build.directory}", property = "outputDir", required = true )
- private File outputDirectory;
-
- public void execute()
- throws MojoExecutionException
- {
- File f = outputDirectory;
-
- if ( !f.exists() )
- {
- f.mkdirs();
- }
-
- File touch = new File( f, "touch.txt" );
-
- FileWriter w = null;
- try
- {
- w = new FileWriter( touch );
-
- w.write( "touch.txt" );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "Error creating file " + touch, e );
- }
- finally
- {
- if ( w != null )
- {
- try
- {
- w.close();
- }
- catch ( IOException e )
- {
- // ignore
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/river-container/blob/3b5a40ff/src/site/markdown/Ideas.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/Ideas.md b/src/site/markdown/Ideas.md
new file mode 100644
index 0000000..3aa89ad
--- /dev/null
+++ b/src/site/markdown/Ideas.md
@@ -0,0 +1,69 @@
+Service Invocation Manager
+--------------------------
+* Somewhat similar to ServiceDiscoveryManager.
+* Purpose is to allow a client to invoke an operation on a service, where there
+may be more than one possible service client.
+ * For instance, if the service interface is to a business process that uses
+corellating data, there might be more than one provider, and every one but the
+"right" one will throw a "process not found" exception.
+ We want to keep the "right" one until such time as we're done interacting
+with it.
+* Two modes of operation:
+ * Cached mode - somewhat like SDMCache, it keeps a cache of discovered services, and
+runs through the cached services when we try to make a call.
+ * Normal mode - When a "discovery" operation is required, it queries all the
+lookup services it can find for candidate services. This would be used for
+a web server installation where SDM can't export a listener.
+
+Business Process
+----------------
+* Inspiration is drawn from how BPEL manages its business processes with a
+"stateless" interface.
+ * In other words, there's no need to lookup a particular process instance and
+then interact with it - you just make operation calls against the stateless
+interface, and the BPEL engine maps the stateless call to the correct instance
+ * Mapping is done using a "Corelation set" that is defined in the interface and
+the process variables. Parameters in the call are used to select the correct
+instance.
+ * e.g. confirmOrder(12667) will map to the instance that holds order 12667.
+ * This gets a little ugly if you allow that there may be more than one service
+that "might" hold a given instance.
+ * you need to try the invocation against all known services that hold that
+interface
+ * Most of these services will return some kind of "no such process" exception,
+but one of them will return successfully.
+ * (note that in all likelihood this means one or two services, not tens or
+hundreds).
+
+
+River Container Maven Plugin
+----------------------------
+
+We'd like to have a plugin that makes it easy to deploy and run an application
+created in Maven. Proposed goals would be something like:
+
+* Goals
+ * `mvn river:deploy` - Installs the current application to the default river
+ container by copying to the 'deploy' dir in the container's default profile.
+ If the container is running, this will effectively load the new service
+ * `mvn river:deploy-client` - Installs the current application to the default
+ river container by copying to the 'deploy' dir in the container's client
+ profile. Note that the plugin doesn't try to figure out whether your app _should_
+ be installed as a client or not - it just takes your word for it.
+ * `mvn river:run` - Contacts the currently running container to deploy the current
+ application (in-place with no copying),
+ undeploying any application with the same name (i.e. the previous version).
+ * `mvn river:run-client` - Runs the current application using the client profile
+ in-place (i.e. no copying to the deploy directory).
+ * `mvn river:start-server` - Starts the server in default profile, or other profile
+ if the `river.container.profile` property is set.
+ * `mvn river:stop-server` - Stops the server's default profile, or other profile if
+ the `river.container.profile` property is set.
+ * `mvn river:list-apps` - Lists the applications currently running in the container.
+* Properties
+ * `river.container.home` - The home directory for the container.
+ * `river.container.profile` - The profile to run as a "server".
+ * `river.container.clientProfile` - The profile to run as a "client".
+
+
+
http://git-wip-us.apache.org/repos/asf/river-container/blob/3b5a40ff/src/site/markdown/index.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
new file mode 100644
index 0000000..25037f2
--- /dev/null
+++ b/src/site/markdown/index.md
@@ -0,0 +1,5 @@
+!River Container
+
+The Apache River Container is an application server that hosts Jini services.
+
+[Ideas](Ideas.html) Ideas for future development.
\ No newline at end of file