felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Custine (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-177) Simplify Felix Framework constructor
Date Fri, 01 Dec 2006 15:49:23 GMT
    [ http://issues.apache.org/jira/browse/FELIX-177?page=comments#action_12454938 ] 
Chris Custine commented on FELIX-177:

I see your point about changing those vars.  The next best thing for something like Spring
would be a non-default constructor where you could inject those dependencies and would not
require the public mutators.  It fulfills the same purpose of making it easier to create and
start an instance declaratively in Spring.  I would actually argue that it may be better all
around to move setting the activator list and the property resolver to the constructor and
only have a start() method with no args.  It doesn't look like there is any way to stop and
re-initialize the instance without creating a new one anyway so it doesn't look like those
vars ever change (unless I am missing something).  This would break the existing Main code
but I will attach another patch for all of it.

> Simplify Felix Framework constructor
> ------------------------------------
>                 Key: FELIX-177
>                 URL: http://issues.apache.org/jira/browse/FELIX-177
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Chris Custine
>            Priority: Trivial
>         Attachments: FELIX-177.diff
> I want to be able to create Felix framework instances and manage their bean dependencies
within a Spring context, so modifying the org.apache.felix.framework.Felix object to have
a default constructor and simple mutators to inject dependencies will make this much easier.
 This will allow a Felix instance to be created in a Spring context as simple as this:
>     <bean id="felix" class="org.apache.felix.framework.Felix" init-method="start"
>         <property name="propertyResolver">
>             <ref bean="propertyResolver"/>
>         </property>
>     </bean>
>     <util:constant static-field="org.apache.felix.framework.cache.BundleCache.CACHE_PROFILE_PROP"/>
>     <bean id="propertyResolver" class="org.apache.felix.framework.util.MutablePropertyResolverImpl">
>         <constructor-arg index="0">
>             <map>
>                 <entry key-ref="org.apache.felix.framework.cache.BundleCache.CACHE_PROFILE_PROP"
>             </map>
>         </constructor-arg>
>     </bean>

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message