You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jason Dillon <ja...@gmail.com> on 2008/10/16 09:24:36 UTC

Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

I didn't really want to expose setLocation in Command, hence the  
reason why it was coded like that.

--jason


On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:

> Author: gnodet
> Date: Wed Oct 15 11:04:24 2008
> New Revision: 704975
>
> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
> Log:
> Remove an ugly cast by adding the setLocation method to the Command  
> interface
>
> Modified:
>    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
> geronimo/gshell/command/Command.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-api/src/main/java/org/apache/ 
> geronimo/gshell/command/Command.java
> URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
> geronimo/gshell/command/Command.java (original)
> +++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
> geronimo/gshell/command/Command.java Wed Oct 15 11:04:24 2008
> @@ -31,6 +31,8 @@
> {
>     CommandLocation getLocation();
>
> +    void setLocation(CommandLocation location);
> +
>     /**
>      * Returns the action of the command.
>      *
>
> 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=704975&r1=704974&r2=704975&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 Wed Oct 15 11:04:24 2008
> @@ -60,9 +60,7 @@
>             throw new DuplicateCommandException(name);
>         }
>
> -        if (command instanceof CommandSupport) {
> -            ((CommandSupport)command).setLocation(new  
> CommandLocationImpl(name));
> -        }
> +        command.setLocation(new CommandLocationImpl(name));
>
>         commands.put(name, command);
>
>
>


Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

Posted by Jason Dillon <ja...@gmail.com>.
Sure, I'm gonna try and get Ivy working.

--jason


On Oct 17, 2008, at 1:32 PM, Guillaume Nodet wrote:

> Looks good, I can work on fixing that if you want.
>
> On Fri, Oct 17, 2008 at 8:23 AM, Jason Dillon  
> <ja...@gmail.com> wrote:
>> Yes, I suppose the PluginParser can set this, and thus avoid  
>> needing to make
>> it part of the Command intf.
>>
>> --jason
>>
>>
>> On Oct 16, 2008, at 2:33 PM, Guillaume Nodet wrote:
>>
>>> Yeah, I was supposing so.
>>> However, it seems more natural, as the only place where the location
>>> is set is when registering the command in the registry.
>>> Maybe another way would be to say that the location has to be set on
>>> the command in some way before registering it: the registry would
>>> retrieve the location from the command instead of receiving it as an
>>> argument to the registerCommand method and then setting the  
>>> location.
>>> As the same command object can not be registered at two different
>>> locations (else one location would be somehow lost on the  
>>> command), it
>>> may make sense.  The location could be set directly when the
>>> PluginParser creates the bean definition.  Wdyt ?
>>>
>>> On Thu, Oct 16, 2008 at 9:24 AM, Jason Dillon <jason.dillon@gmail.com 
>>> >
>>> wrote:
>>>>
>>>> I didn't really want to expose setLocation in Command, hence the  
>>>> reason
>>>> why
>>>> it was coded like that.
>>>>
>>>> --jason
>>>>
>>>>
>>>> On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:
>>>>
>>>>> Author: gnodet
>>>>> Date: Wed Oct 15 11:04:24 2008
>>>>> New Revision: 704975
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
>>>>> Log:
>>>>> Remove an ugly cast by adding the setLocation method to the  
>>>>> Command
>>>>> interface
>>>>>
>>>>> Modified:
>>>>>
>>>>>
>>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
>>>>> geronimo/gshell/command/Command.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-api/src/main/java/org/apache/ 
>>>>> geronimo/gshell/command/Command.java
>>>>> URL:
>>>>>
>>>>> http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
>>>>>
>>>>>
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> ---
>>>>>
>>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
>>>>> geronimo/gshell/command/Command.java
>>>>> (original)
>>>>> +++
>>>>>
>>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/ 
>>>>> geronimo/gshell/command/Command.java
>>>>> Wed Oct 15 11:04:24 2008
>>>>> @@ -31,6 +31,8 @@
>>>>> {
>>>>> CommandLocation getLocation();
>>>>>
>>>>> +    void setLocation(CommandLocation location);
>>>>> +
>>>>> /**
>>>>>  * Returns the action of the command.
>>>>>  *
>>>>>
>>>>> 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=704975&r1=704974&r2=704975&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
>>>>> Wed Oct 15 11:04:24 2008
>>>>> @@ -60,9 +60,7 @@
>>>>>         throw new DuplicateCommandException(name);
>>>>>     }
>>>>>
>>>>> -        if (command instanceof CommandSupport) {
>>>>> -            ((CommandSupport)command).setLocation(new
>>>>> CommandLocationImpl(name));
>>>>> -        }
>>>>> +        command.setLocation(new CommandLocationImpl(name));
>>>>>
>>>>>     commands.put(name, command);
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>
>>
>
>
>
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com


Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

Posted by Guillaume Nodet <gn...@gmail.com>.
Looks good, I can work on fixing that if you want.

On Fri, Oct 17, 2008 at 8:23 AM, Jason Dillon <ja...@gmail.com> wrote:
> Yes, I suppose the PluginParser can set this, and thus avoid needing to make
> it part of the Command intf.
>
> --jason
>
>
> On Oct 16, 2008, at 2:33 PM, Guillaume Nodet wrote:
>
>> Yeah, I was supposing so.
>> However, it seems more natural, as the only place where the location
>> is set is when registering the command in the registry.
>> Maybe another way would be to say that the location has to be set on
>> the command in some way before registering it: the registry would
>> retrieve the location from the command instead of receiving it as an
>> argument to the registerCommand method and then setting the location.
>> As the same command object can not be registered at two different
>> locations (else one location would be somehow lost on the command), it
>> may make sense.  The location could be set directly when the
>> PluginParser creates the bean definition.  Wdyt ?
>>
>> On Thu, Oct 16, 2008 at 9:24 AM, Jason Dillon <ja...@gmail.com>
>> wrote:
>>>
>>> I didn't really want to expose setLocation in Command, hence the reason
>>> why
>>> it was coded like that.
>>>
>>> --jason
>>>
>>>
>>> On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:
>>>
>>>> Author: gnodet
>>>> Date: Wed Oct 15 11:04:24 2008
>>>> New Revision: 704975
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
>>>> Log:
>>>> Remove an ugly cast by adding the setLocation method to the Command
>>>> interface
>>>>
>>>> Modified:
>>>>
>>>>
>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.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-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>>> URL:
>>>>
>>>> http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> ---
>>>>
>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>>> (original)
>>>> +++
>>>>
>>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>>> Wed Oct 15 11:04:24 2008
>>>> @@ -31,6 +31,8 @@
>>>> {
>>>>  CommandLocation getLocation();
>>>>
>>>> +    void setLocation(CommandLocation location);
>>>> +
>>>>  /**
>>>>   * Returns the action of the command.
>>>>   *
>>>>
>>>> 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=704975&r1=704974&r2=704975&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
>>>> Wed Oct 15 11:04:24 2008
>>>> @@ -60,9 +60,7 @@
>>>>          throw new DuplicateCommandException(name);
>>>>      }
>>>>
>>>> -        if (command instanceof CommandSupport) {
>>>> -            ((CommandSupport)command).setLocation(new
>>>> CommandLocationImpl(name));
>>>> -        }
>>>> +        command.setLocation(new CommandLocationImpl(name));
>>>>
>>>>      commands.put(name, command);
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

Posted by Jason Dillon <ja...@gmail.com>.
Yes, I suppose the PluginParser can set this, and thus avoid needing  
to make it part of the Command intf.

--jason


On Oct 16, 2008, at 2:33 PM, Guillaume Nodet wrote:

> Yeah, I was supposing so.
> However, it seems more natural, as the only place where the location
> is set is when registering the command in the registry.
> Maybe another way would be to say that the location has to be set on
> the command in some way before registering it: the registry would
> retrieve the location from the command instead of receiving it as an
> argument to the registerCommand method and then setting the location.
> As the same command object can not be registered at two different
> locations (else one location would be somehow lost on the command), it
> may make sense.  The location could be set directly when the
> PluginParser creates the bean definition.  Wdyt ?
>
> On Thu, Oct 16, 2008 at 9:24 AM, Jason Dillon  
> <ja...@gmail.com> wrote:
>> I didn't really want to expose setLocation in Command, hence the  
>> reason why
>> it was coded like that.
>>
>> --jason
>>
>>
>> On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:
>>
>>> Author: gnodet
>>> Date: Wed Oct 15 11:04:24 2008
>>> New Revision: 704975
>>>
>>> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
>>> Log:
>>> Remove an ugly cast by adding the setLocation method to the Command
>>> interface
>>>
>>> Modified:
>>>
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/ 
>>> gshell/command/Command.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-api/src/main/java/org/apache/geronimo/ 
>>> gshell/command/Command.java
>>> URL:
>>> http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
>>>
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> ---
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/ 
>>> gshell/command/Command.java
>>> (original)
>>> +++
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/ 
>>> gshell/command/Command.java
>>> Wed Oct 15 11:04:24 2008
>>> @@ -31,6 +31,8 @@
>>> {
>>>   CommandLocation getLocation();
>>>
>>> +    void setLocation(CommandLocation location);
>>> +
>>>   /**
>>>    * Returns the action of the command.
>>>    *
>>>
>>> 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=704975&r1=704974&r2=704975&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
>>> Wed Oct 15 11:04:24 2008
>>> @@ -60,9 +60,7 @@
>>>           throw new DuplicateCommandException(name);
>>>       }
>>>
>>> -        if (command instanceof CommandSupport) {
>>> -            ((CommandSupport)command).setLocation(new
>>> CommandLocationImpl(name));
>>> -        }
>>> +        command.setLocation(new CommandLocationImpl(name));
>>>
>>>       commands.put(name, command);
>>>
>>>
>>>
>>
>>
>
>
>
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com


Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

Posted by Guillaume Nodet <gn...@gmail.com>.
Actually, using a cast makes things very difficult to use in OSGi, as
when using spring-dm in OSGi, it creates proxies for the commands, so
the cast does not work and we end up with exceptions everywhere, as
the location is a mandatory part of the command.

On Thu, Oct 16, 2008 at 9:33 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> Yeah, I was supposing so.
> However, it seems more natural, as the only place where the location
> is set is when registering the command in the registry.
> Maybe another way would be to say that the location has to be set on
> the command in some way before registering it: the registry would
> retrieve the location from the command instead of receiving it as an
> argument to the registerCommand method and then setting the location.
> As the same command object can not be registered at two different
> locations (else one location would be somehow lost on the command), it
> may make sense.  The location could be set directly when the
> PluginParser creates the bean definition.  Wdyt ?
>
> On Thu, Oct 16, 2008 at 9:24 AM, Jason Dillon <ja...@gmail.com> wrote:
>> I didn't really want to expose setLocation in Command, hence the reason why
>> it was coded like that.
>>
>> --jason
>>
>>
>> On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:
>>
>>> Author: gnodet
>>> Date: Wed Oct 15 11:04:24 2008
>>> New Revision: 704975
>>>
>>> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
>>> Log:
>>> Remove an ugly cast by adding the setLocation method to the Command
>>> interface
>>>
>>> Modified:
>>>
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.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-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>> URL:
>>> http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>> (original)
>>> +++
>>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>>> Wed Oct 15 11:04:24 2008
>>> @@ -31,6 +31,8 @@
>>> {
>>>    CommandLocation getLocation();
>>>
>>> +    void setLocation(CommandLocation location);
>>> +
>>>    /**
>>>     * Returns the action of the command.
>>>     *
>>>
>>> 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=704975&r1=704974&r2=704975&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
>>> Wed Oct 15 11:04:24 2008
>>> @@ -60,9 +60,7 @@
>>>            throw new DuplicateCommandException(name);
>>>        }
>>>
>>> -        if (command instanceof CommandSupport) {
>>> -            ((CommandSupport)command).setLocation(new
>>> CommandLocationImpl(name));
>>> -        }
>>> +        command.setLocation(new CommandLocationImpl(name));
>>>
>>>        commands.put(name, command);
>>>
>>>
>>>
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: svn commit: r704975 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/registry/CommandRegistryImpl.java

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah, I was supposing so.
However, it seems more natural, as the only place where the location
is set is when registering the command in the registry.
Maybe another way would be to say that the location has to be set on
the command in some way before registering it: the registry would
retrieve the location from the command instead of receiving it as an
argument to the registerCommand method and then setting the location.
As the same command object can not be registered at two different
locations (else one location would be somehow lost on the command), it
may make sense.  The location could be set directly when the
PluginParser creates the bean definition.  Wdyt ?

On Thu, Oct 16, 2008 at 9:24 AM, Jason Dillon <ja...@gmail.com> wrote:
> I didn't really want to expose setLocation in Command, hence the reason why
> it was coded like that.
>
> --jason
>
>
> On Oct 16, 2008, at 1:04 AM, gnodet@apache.org wrote:
>
>> Author: gnodet
>> Date: Wed Oct 15 11:04:24 2008
>> New Revision: 704975
>>
>> URL: http://svn.apache.org/viewvc?rev=704975&view=rev
>> Log:
>> Remove an ugly cast by adding the setLocation method to the Command
>> interface
>>
>> Modified:
>>
>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.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-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>> URL:
>> http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=704975&r1=704974&r2=704975&view=diff
>>
>> ==============================================================================
>> ---
>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>> (original)
>> +++
>> geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
>> Wed Oct 15 11:04:24 2008
>> @@ -31,6 +31,8 @@
>> {
>>    CommandLocation getLocation();
>>
>> +    void setLocation(CommandLocation location);
>> +
>>    /**
>>     * Returns the action of the command.
>>     *
>>
>> 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=704975&r1=704974&r2=704975&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
>> Wed Oct 15 11:04:24 2008
>> @@ -60,9 +60,7 @@
>>            throw new DuplicateCommandException(name);
>>        }
>>
>> -        if (command instanceof CommandSupport) {
>> -            ((CommandSupport)command).setLocation(new
>> CommandLocationImpl(name));
>> -        }
>> +        command.setLocation(new CommandLocationImpl(name));
>>
>>        commands.put(name, command);
>>
>>
>>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com