hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hackaton <hackaton-nab...@yahoo.com>
Subject Re: Array of String as parameter
Date Fri, 25 Jan 2008 09:01:10 GMT

I took your first approach. As I am totally new to hivemind, the follow
concepts are new to me; it worked for me but I just want to make sure I
understand them correctly :

a)"…register a property editor…"
b)"…contribution to hivemind.Startup…"

For point a)
Extended the java.beans.PropertyEditorSupport and override the setAsText to
convert String to a String array

For point b)
1)Added a PropertyEditorLoader class by implement the Runnable to call the
PropertyEditorManager.registerEditor as:
PropertyEditorManager.registerEditor(String[].class,
StringArrayPropertyEditor.class);

2) Wire them as
…
<service-point id="PropertyEditorLoader" interface="java.lang.Runnable">
    <create-instance class="PropertyEditorLoader" />
</service-point>

<contribution configuration-id="hivemind.Startup">
    <startup object="service:PropertyEditorLoader"/>
</contribution>
...

Finally, all services should get the PropertyEditorLoader ready except those
instantiated directly or indirectly through hivemind.Startup or
hivemind.EagerLoad.


Raffael Herzog-2 wrote:
> 
> Am Dienstag, 22. Januar 2008 08.43:51 schrieb hackaton:
>> I am using HiveMind 1.1. Could I pass an array of String as parameter? If
>> so what is its lightweight instance initialization syntax?
> 
> You could register a property editor for String[]. Unfortunately, there's
> no 
> way to ensure that such an editor will be registered before any other 
> HiveMind service is instanciated. You could e.g. create a configuration 
> point where one can register new property editors. You could then create a 
> contribution to hivemind.Startup that registers those contributed editors. 
> However, using this method, you'll have to be aware that there's no 
> guarantee that the new property editors are available in any class that 
> gets instantiated directly or indirectly through hivemind.Startup or 
> hivemind.EagerLoad.
> 
> If this is not acceptible, you'll have to register your editors in the 
> bootstrapper before you build the registry.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Array-of-String-as-parameter-tp15014029p15083729.html
Sent from the Hivemind - User mailing list archive at Nabble.com.


Mime
View raw message