You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/10/05 13:35:59 UTC

svn commit: r701779 - in /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main: java/org/apache/geronimo/gshell/wisdom/meta/ java/org/apache/geronimo/gshell/wisdom/plugin/ java/org/apache/geronimo/gshell/wisdom/registry/ resources/META-INF/s...

Author: jdillon
Date: Sun Oct  5 04:35:58 2008
New Revision: 701779

URL: http://svn.apache.org/viewvc?rev=701779&view=rev
Log:
Update for rename
Adding meta:/system/properties -> SystemPropertiesMetaData which dumps the contents of System.getProperties() via `cat meta:/system/properties`

Added:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java   (with props)
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java   (with props)
Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/AliasRegistryImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java?rev=701779&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java (added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java Sun Oct  5 04:35:58 2008
@@ -0,0 +1,58 @@
+/*
+ * 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.geronimo.gshell.wisdom.meta;
+
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaData;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistry;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistryConfigurer;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileType;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.annotation.PostConstruct;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.Map;
+import java.util.LinkedHashMap;
+
+/**
+ * Installs {@link MetaData} into the {@link MetaDataRegistry}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MetaDataInstaller
+{
+    @Autowired
+    private MetaDataRegistry metaRegistry;
+
+    // private MetaDataRegistryConfigurer metaConfig;
+
+    @PostConstruct
+    public void init() throws Exception {
+        assert metaRegistry != null;
+        MetaDataRegistryConfigurer metaConfig = new MetaDataRegistryConfigurer(metaRegistry);
+
+        // HACK: Hard code this for now, evetually configure via spring
+        metaConfig.addFolder("/system");
+        FileName name = metaConfig.getNameParser().parseUri("/system/properties");
+        metaConfig.add(name, new SystemPropertiesMetaData(name));
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/MetaDataInstaller.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java?rev=701779&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java (added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java Sun Oct  5 04:35:58 2008
@@ -0,0 +1,57 @@
+/*
+ * 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.geronimo.gshell.wisdom.meta;
+
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaData;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileType;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * {@link MetaData} to return the contents of {@link System#getProperties}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SystemPropertiesMetaData
+    extends MetaData
+{
+    public SystemPropertiesMetaData(final FileName name) {
+        super(name, FileType.FILE);
+    }
+
+    @Override
+    public byte[] getBuffer() {
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+
+        Properties props = System.getProperties();
+
+        try {
+            props.store(output, "System Properties");
+        }
+        catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+        return output.toByteArray();
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/meta/SystemPropertiesMetaData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=701779&r1=701778&r2=701779&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 Sun Oct  5 04:35:58 2008
@@ -32,9 +32,9 @@
 import org.apache.geronimo.gshell.spring.BeanContainer;
 import org.apache.geronimo.gshell.spring.BeanContainerAware;
 import org.apache.geronimo.gshell.wisdom.application.ApplicationConfiguredEvent;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistry;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistryConfigurer;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileData;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistry;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistryConfigurer;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaData;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
@@ -76,9 +76,9 @@
     private BeanContainer container;
 
     @Autowired
-    private MetaFileDataRegistry metaRegistry;
+    private MetaDataRegistry metaRegistry;
 
-    private MetaFileDataRegistryConfigurer metaConfig;
+    private MetaDataRegistryConfigurer metaConfig;
 
     private Set<Plugin> plugins = new LinkedHashSet<Plugin>();
 
@@ -91,7 +91,7 @@
     @PostConstruct
     public void init() {
         assert metaRegistry != null;
-        metaConfig = new MetaFileDataRegistryConfigurer(metaRegistry);
+        metaConfig = new MetaDataRegistryConfigurer(metaRegistry);
         metaConfig.addFolder("/plugins");
 
         assert eventManager != null;
@@ -152,7 +152,7 @@
         plugin.initArtifacts(artifacts);
 
         assert metaConfig != null;
-        MetaFileData data = metaConfig.addFile("/plugins/" + plugin.getName());
+        MetaData data = metaConfig.addFile("/plugins/" + plugin.getName());
         data.addAttribute("PLUGIN", plugin);
 
         plugins.add(plugin);

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/AliasRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/AliasRegistryImpl.java?rev=701779&r1=701778&r2=701779&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/AliasRegistryImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/AliasRegistryImpl.java Sun Oct  5 04:35:58 2008
@@ -22,10 +22,9 @@
 import org.apache.geronimo.gshell.event.EventPublisher;
 import org.apache.geronimo.gshell.registry.AliasRegistry;
 import org.apache.geronimo.gshell.registry.NoSuchAliasException;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistry;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistryConfigurer;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileData;
-import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistry;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistryConfigurer;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,16 +49,16 @@
     private EventPublisher eventPublisher;
 
     @Autowired
-    private MetaFileDataRegistry metaRegistry;
+    private MetaDataRegistry metaRegistry;
 
-    private MetaFileDataRegistryConfigurer metaConfig;
+    private MetaDataRegistryConfigurer metaConfig;
 
     private final Map<String,String> aliases = new LinkedHashMap<String,String>();
 
     @PostConstruct
     public void init() {
         assert metaRegistry != null;
-        metaConfig = new MetaFileDataRegistryConfigurer(metaRegistry);
+        metaConfig = new MetaDataRegistryConfigurer(metaRegistry);
         metaConfig.addFolder("/aliases");
     }
 
@@ -74,7 +73,7 @@
         }
 
         assert metaConfig != null;
-        MetaFileData data = metaConfig.addFile("/aliases/" + name);
+        MetaData data = metaConfig.addFile("/aliases/" + name);
         data.addAttribute("ALIAS", alias);
 
         aliases.put(name, alias);

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java?rev=701779&r1=701778&r2=701779&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java Sun Oct  5 04:35:58 2008
@@ -24,9 +24,9 @@
 import org.apache.geronimo.gshell.registry.CommandRegistry;
 import org.apache.geronimo.gshell.registry.NoSuchCommandException;
 import org.apache.geronimo.gshell.registry.DuplicateCommandException;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistry;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileDataRegistryConfigurer;
-import org.apache.geronimo.gshell.vfs.provider.meta.MetaFileData;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistry;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaDataRegistryConfigurer;
+import org.apache.geronimo.gshell.vfs.provider.meta.MetaData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,16 +51,16 @@
     private EventPublisher eventPublisher;
 
     @Autowired
-    private MetaFileDataRegistry metaRegistry;
+    private MetaDataRegistry metaRegistry;
 
-    private MetaFileDataRegistryConfigurer metaConfig;
+    private MetaDataRegistryConfigurer metaConfig;
 
     private final Map<String,Command> commands = new LinkedHashMap<String,Command>();
 
     @PostConstruct
     public void init() {
         assert metaRegistry != null;
-        metaConfig = new MetaFileDataRegistryConfigurer(metaRegistry);
+        metaConfig = new MetaDataRegistryConfigurer(metaRegistry);
         metaConfig.addFolder("/commands");
     }
 
@@ -75,7 +75,7 @@
         }
 
         assert metaConfig != null;
-        MetaFileData data = metaConfig.addFile("/commands/" + name);
+        MetaData data = metaConfig.addFile("/commands/" + name);
         data.addAttribute("COMMAND", command);
 
         commands.put(name, command);

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml?rev=701779&r1=701778&r2=701779&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml Sun Oct  5 04:35:58 2008
@@ -58,6 +58,10 @@
 
     <bean id="commandsCompleter" class="org.apache.geronimo.gshell.wisdom.completer.CommandsCompleter"/>
 
+    <bean class="org.apache.geronimo.gshell.wisdom.meta.MetaDataInstaller">
+        
+    </bean>
+
     <bean id="pluginTemplate" class="org.apache.geronimo.gshell.wisdom.plugin.PluginImpl" abstract="true">
         <property name="activationRules">
             <list>