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/04 21:17:41 UTC
svn commit: r701692 - in /geronimo/gshell/trunk:
gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/
gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/
gshell-wisdom/gshell-wi...
Author: jdillon
Date: Sat Oct 4 12:17:41 2008
New Revision: 701692
URL: http://svn.apache.org/viewvc?rev=701692&view=rev
Log:
Adding meta files for plugins under meta:/plugins/*
Adding meta files for aliases under meta:/aliases/*
Modified:
geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileData.java
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
Modified: geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileData.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileData.java?rev=701692&r1=701691&r2=701692&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileData.java (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-vfs-meta/src/main/java/org/apache/geronimo/gshell/vfs/provider/meta/MetaFileData.java Sat Oct 4 12:17:41 2008
@@ -42,6 +42,10 @@
private final FileName name;
+ //
+ // TODO: Consider making all meta files FileType.FILE_OR_FOLDER
+ //
+
private final FileType type;
private long lastModified = -1;
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=701692&r1=701691&r2=701692&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 Sat Oct 4 12:17:41 2008
@@ -32,6 +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.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
@@ -72,6 +75,11 @@
private BeanContainer container;
+ @Autowired
+ private MetaFileDataRegistry metaRegistry;
+
+ private MetaFileDataRegistryConfigurer metaConfig;
+
private Set<Plugin> plugins = new LinkedHashSet<Plugin>();
public void setBeanContainer(final BeanContainer container) {
@@ -82,6 +90,10 @@
@PostConstruct
public void init() {
+ assert metaRegistry != null;
+ metaConfig = new MetaFileDataRegistryConfigurer(metaRegistry);
+ metaConfig.addFolder("/plugins");
+
assert eventManager != null;
eventManager.addListener(new EventListener() {
public void onEvent(Event event) throws Exception {
@@ -139,6 +151,10 @@
plugin.initArtifact(artifact);
plugin.initArtifacts(artifacts);
+ assert metaConfig != null;
+ MetaFileData data = metaConfig.addFile("/plugins/" + plugin.getName());
+ data.addAttribute("PLUGIN", plugin);
+
plugins.add(plugin);
log.debug("Activating plugin: {}", plugin.getName());
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=701692&r1=701691&r2=701692&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 Sat Oct 4 12:17:41 2008
@@ -22,10 +22,15 @@
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
@@ -44,8 +49,20 @@
@Autowired
private EventPublisher eventPublisher;
+ @Autowired
+ private MetaFileDataRegistry metaRegistry;
+
+ private MetaFileDataRegistryConfigurer metaConfig;
+
private final Map<String,String> aliases = new LinkedHashMap<String,String>();
+ @PostConstruct
+ public void init() {
+ assert metaRegistry != null;
+ metaConfig = new MetaFileDataRegistryConfigurer(metaRegistry);
+ metaConfig.addFolder("/aliases");
+ }
+
public void registerAlias(final String name, final String alias) {
assert name != null;
assert alias != null;
@@ -56,6 +73,10 @@
log.debug("Replacing alias: {}", name);
}
+ assert metaConfig != null;
+ MetaFileData data = metaConfig.addFile("/aliases/" + name);
+ data.addAttribute("ALIAS", alias);
+
aliases.put(name, alias);
eventPublisher.publish(new AliasRegisteredEvent(name, alias));
@@ -70,6 +91,8 @@
throw new NoSuchAliasException(name);
}
+ // TODO: Remove from meta
+
aliases.remove(name);
eventPublisher.publish(new AliasRemovedEvent(name));
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=701692&r1=701691&r2=701692&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 Sat Oct 4 12:17:41 2008
@@ -76,8 +76,6 @@
assert metaConfig != null;
MetaFileData data = metaConfig.addFile("/commands/" + name);
-
- // HACK: For now just add something
data.addAttribute("COMMAND", command);
commands.put(name, command);