geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r694646 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/ gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ gshell-support/gshell-artifact/src/main/java/org/apache/geroni...
Date Fri, 12 Sep 2008 08:22:11 GMT
Author: jdillon
Date: Fri Sep 12 01:22:10 2008
New Revision: 694646

URL: http://svn.apache.org/viewvc?rev=694646&view=rev
Log:
Some clean up, added Artifact.getId()

Modified:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Artifact.java
    geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
Fri Sep 12 01:22:10 2008
@@ -30,6 +30,8 @@
  */
 public interface Application
 {
+    String getId();
+    
     IO getIo();
 
     Variables getVariables();

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Artifact.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Artifact.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Artifact.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Artifact.java
Fri Sep 12 01:22:10 2008
@@ -80,4 +80,8 @@
     public void setVersion(final String version) {
         this.version = version;
     }
+
+    public String getId() {
+        return getGroupId() + ":" + getArtifactId() + ":" + getVersion() + ":" + getType();
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-artifact/src/main/java/org/apache/geronimo/gshell/artifact/ArtifactManagerFactory.java
Fri Sep 12 01:22:10 2008
@@ -43,6 +43,10 @@
 
     private PlexusContainer container;
 
+    //
+    // FIXME: Seems like we get multipule instances of this puppy created, when we only need
one
+    //
+
     @PostConstruct
     public void init() throws Exception {
         DefaultContainerConfiguration config = new DefaultContainerConfiguration();

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
Fri Sep 12 01:22:10 2008
@@ -114,6 +114,10 @@
 
         // Create a new context
         application = new Application() {
+            public String getId() {
+                return config.getModel().getId();
+            }
+
             public IO getIo() {
                 return config.getIo();
             }
@@ -157,52 +161,52 @@
         config.setModel(model);
     }
 
-    private void configure(final ApplicationModel applicationModel) throws Exception {
-        assert applicationModel != null;
+    private void configure(final ApplicationModel model) throws Exception {
+        assert model != null;
 
-        log.debug("Application ID: {}", applicationModel.getId());
-        log.trace("Application descriptor: {}", applicationModel);
+        log.debug("Application ID: {}", model.getId());
+        log.trace("Application descriptor: {}", model);
 
         // Apply artifact manager configuration settings for application
-        configureArtifactManager(applicationModel);
+        configureArtifactManager(model);
 
         // Create the application container
-        applicationContainer = createContainer(applicationModel);
+        applicationContainer = createContainer(model);
     }
 
-    private void configureArtifactManager(final ApplicationModel applicationModel) throws
Exception {
-        assert applicationModel != null;
+    private void configureArtifactManager(final ApplicationModel model) throws Exception
{
+        assert model != null;
         assert artifactManager != null;
 
         // Setup the local repository
-        LocalRepository localRepository = applicationModel.getLocalRepository();
+        LocalRepository localRepository = model.getLocalRepository();
 
         if (localRepository != null) {
             artifactManager.getRepositoryManager().setLocalRepository(localRepository.getDirectoryFile());
         }
 
         // Setup remote repositories
-        for (RemoteRepository repo : applicationModel.getRemoteRepositories()) {
+        for (RemoteRepository repo : model.getRemoteRepositories()) {
             artifactManager.getRepositoryManager().addRemoteRepository(repo.getId(), repo.getLocationUri());
         }
     }
 
-    private BeanContainer createContainer(final ApplicationModel applicationModel) throws
Exception {
-        assert applicationModel != null;
+    private BeanContainer createContainer(final ApplicationModel model) throws Exception
{
+        assert model != null;
 
         log.debug("Creating application container");
 
-        List<URL> classPath = createClassPath(applicationModel);
+        List<URL> classPath = createClassPath(model);
 
-        BeanContainer child = container.createChild("application[" + applicationModel.getId()
+ "]", classPath);
+        BeanContainer child = container.createChild("gshell.application[" + model.getId()
+ "]", classPath);
 
         log.debug("Application container: {}", child);
 
         return child;
     }
 
-    private List<URL> createClassPath(final ApplicationModel applicationModel) throws
Exception {
-        assert applicationModel != null;
+    private List<URL> createClassPath(final ApplicationModel model) throws Exception
{
+        assert model != null;
 
         ArtifactResolutionRequest request = new ArtifactResolutionRequest();
 
@@ -263,7 +267,7 @@
         request.setFilter(filter);
 
         Set<Artifact> artifacts = new LinkedHashSet<Artifact>();
-        List<Dependency> dependencies = applicationModel.getDependencies(true); //
include groups
+        List<Dependency> dependencies = model.getDependencies(true); // include groups
 
         if (!dependencies.isEmpty()) {
             ArtifactFactory factory = artifactManager.getArtifactFactory();
@@ -304,6 +308,10 @@
         return classPath;
     }
 
+    //
+    // ShellFactory
+    //
+
     public Shell create() throws Exception {
         // Make sure that we have a valid context
         getApplication();

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
Fri Sep 12 01:22:10 2008
@@ -116,13 +116,13 @@
         config.setModel(model);
     }
 
-    private void configure(final SettingsModel settingsModel) throws Exception {
-        assert settingsModel != null;
+    private void configure(final SettingsModel model) throws Exception {
+        assert model != null;
 
         // TODO: Add settings interpolation here
 
         // Setup remote repositories
-        for (RemoteRepository repo : settingsModel.remoteRepositories()) {
+        for (RemoteRepository repo : model.remoteRepositories()) {
             artifactManager.getRepositoryManager().addRemoteRepository(repo.getId(), repo.getLocationUri());
         }
 

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java?rev=694646&r1=694645&r2=694646&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
Fri Sep 12 01:22:10 2008
@@ -81,7 +81,7 @@
     private void loadPlugins(final Application application) {
         assert application != null;
 
-        log.debug("Loading plugins for application: {}", application.getModel().getId());
+        log.debug("Loading plugins for application: {}", application.getId());
 
         List<Plugin> plugins = application.getModel().getPlugins(true);
 
@@ -98,11 +98,11 @@
     private void loadPlugin(final Plugin plugin) throws Exception {
         assert plugin != null;
 
-        log.debug("Loading plugin: {}", plugin);
+        log.debug("Loading plugin: {}", plugin.getId());
 
         List<URL> classPath = createClassPath(plugin);
 
-        BeanContainer pluginContainer = container.createChild("plugin[" + plugin + "]", classPath);
+        BeanContainer pluginContainer = container.createChild("gshell.plugin[" + plugin.getId()
+ "]", classPath);
 
         pluginContainer.publish(new PluginLoadedEvent(this, plugin));
     }



Mime
View raw message