geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r698996 - in /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias: AliasDefinedEvent.java AliasManagerImpl.java AliasUndefinedEvent.java
Date Thu, 25 Sep 2008 15:04:17 GMT
Author: jdillon
Date: Thu Sep 25 08:04:15 2008
New Revision: 698996

URL: http://svn.apache.org/viewvc?rev=698996&view=rev
Log:
Add alias [un]defined events

Added:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.java
  (with props)
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.java
  (with props)
Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasManagerImpl.java

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.java?rev=698996&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.java
(added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.java
Thu Sep 25 08:04:15 2008
@@ -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 org.apache.geronimo.gshell.wisdom.alias;
+
+import org.apache.geronimo.gshell.alias.Alias;
+import org.apache.geronimo.gshell.event.Event;
+
+/**
+ * Event fired once an alias has been defined.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AliasDefinedEvent
+    implements Event
+{
+    private final Alias alias;
+
+    public AliasDefinedEvent(final Alias alias) {
+        assert alias != null;
+
+        this.alias = alias;
+    }
+
+    public Alias getAlias() {
+        return alias;
+    }
+}
\ No newline at end of file

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

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasDefinedEvent.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/alias/AliasDefinedEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasManagerImpl.java?rev=698996&r1=698995&r2=698996&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasManagerImpl.java
Thu Sep 25 08:04:15 2008
@@ -22,6 +22,7 @@
 import org.apache.geronimo.gshell.alias.Alias;
 import org.apache.geronimo.gshell.alias.AliasManager;
 import org.apache.geronimo.gshell.command.CommandRegistry;
+import org.apache.geronimo.gshell.event.EventPublisher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,9 @@
     @Autowired
     private CommandRegistry commandRegistry;
 
+    @Autowired
+    private EventPublisher eventPublisher;
+
     private Map<String,Alias> aliases = new LinkedHashMap<String,Alias>();
 
     public Collection<Alias> getAliases() {
@@ -75,7 +79,7 @@
 
         // TODO: Register AliasCommand
 
-        // TODO: Fire event?
+        eventPublisher.publish(new AliasDefinedEvent(alias));
 
         return alias;
     }
@@ -92,7 +96,7 @@
         else {
             // TODO: Unregister AliasCommand
 
-            // TODO: Fire event?
+            eventPublisher.publish(new AliasUndefinedEvent(alias));
         }
     }
 }

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.java?rev=698996&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.java
(added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.java
Thu Sep 25 08:04:15 2008
@@ -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 org.apache.geronimo.gshell.wisdom.alias;
+
+import org.apache.geronimo.gshell.alias.Alias;
+import org.apache.geronimo.gshell.event.Event;
+
+/**
+ * Event fired once an alias has been undefined.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AliasUndefinedEvent
+    implements Event
+{
+    private final Alias alias;
+
+    public AliasUndefinedEvent(final Alias alias) {
+        assert alias != null;
+
+        this.alias = alias;
+    }
+
+    public Alias getAlias() {
+        return alias;
+    }
+}
\ No newline at end of file

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

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/alias/AliasUndefinedEvent.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/alias/AliasUndefinedEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message