You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sahoo <Sa...@Sun.COM> on 2009/04/30 16:38:19 UTC

Contradictory requirements about Bundle-SymbolicName

The javadoc of Bundle.getSymbolicName() says the following:
     * The name must be unique,
     * it is recommended to use a reverse domain name naming convention
     * like that used for java packages. If this bundle does not have a
     * specified symbolic name then <code>null</code> is returned.


How can the name be unique when null is allowed as a valid value?

Thanks,
Sahoo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Contradictory requirements about Bundle-SymbolicName

Posted by "Richard S. Hall" <he...@ungoverned.org>.
R3 bundles are allowed to not have a symbolic name, so null is returned.

R4 bundles must have a symbolic name, so they cannot have null for a 
symbolic name (an R4 bundle has "Bundle-ManifestVersion: 2" in its 
manifest).

A symbolic name is not unique. Only symbolic name + bundle version must 
be unique.

-> richard

On 4/30/09 10:38 AM, Sahoo wrote:
> The javadoc of Bundle.getSymbolicName() says the following:
>     * The name must be unique,
>     * it is recommended to use a reverse domain name naming convention
>     * like that used for java packages. If this bundle does not have a
>     * specified symbolic name then <code>null</code> is returned.
>
>
> How can the name be unique when null is allowed as a valid value?
>
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Custom BundleCache?

Posted by Ted Stockwell <em...@yahoo.com>.
Oops, shoulda thought of that myself.
Done.


--- On Sun, 5/3/09, Richard S. Hall <he...@ungoverned.org> wrote:

> From: Richard S. Hall <he...@ungoverned.org>
> Subject: Re: Custom BundleCache?
> To: users@felix.apache.org
> Date: Sunday, May 3, 2009, 11:23 AM
> Ted,
> 
> Certainly sounds like the simplest approach. You should
> really create an 
> issue for this in JIRA and attach your patch to it:
> 
>      http://issues.apache.org/jira/browse/FELIX
> 
> Make sure to check the grant checkbox.
> 



      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Custom BundleCache?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Ted,

Certainly sounds like the simplest approach. You should really create an 
issue for this in JIRA and attach your patch to it:

     http://issues.apache.org/jira/browse/FELIX

Make sure to check the grant checkbox.

-> richard

On 5/3/09 12:19 PM, Ted Stockwell wrote:
> Hi All,
>
> After thinking about how to customize the system bundle cache, with a eye on not making the base code bigger, it struck me that the simplest thing to do would be to pass a BundleCache implementation in the configuration map that is passed to the Felix construction, as is done for system activators.
>
> So for now I have added this code to the FelixConstants class...
>      public static final String SYSTEMBUNDLE_BUNDLE_CACHE
>      	= "felix.systembundle.bundle.cache";
>
> and I added this code to the Felix.init method...
> // Create the bundle cache, if necessary, so that we can reload any installed bundles.
> m_cache= (BundleCache) m_configMutableMap.get(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE);
> if (m_cache == null)
> {
>      try
>      {
> 	m_cache = new BundleCache(m_logger, m_configMap);
>      }
>      catch (Exception ex)
>      {
> 	m_logger.log(Logger.LOG_ERROR, "Error creating bundle cache.", ex);
> 	throw new BundleException("Error creating bundle cache.", ex);
>      }
> }
>
>
> then in my code I do this....
> configMap.put(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE, new Felix4GAEBundleCache());
> Felix framework= new Felix(configMap);
>
> I have attached a patch file if you are inclined to apply these changes.
>
>
> Thanks,
> -ted
>
> BTW, I will release felix4gae here, http://code.google.com/p/felix4gae.
> I am working on this in the evenings so it will probably take a couple of weeks.
>
>
>
>
>
>
>
>
>
> --- On Fri, 5/1/09, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>    
>> From: Richard S. Hall<he...@ungoverned.org>
>> Subject: Re: Custom BundleCache?
>> To: users@felix.apache.org
>> Date: Friday, May 1, 2009, 12:44 PM
>> On 5/1/09 8:37 AM, Ted Stockwell wrote:
>>      
>>> Is the custom BundleCache something that the Felix
>>>        
>> group might be interested in merging back into the Felix
>> code?  (that's another reason for my asking, it would be
>> nice if eventually my custom version of Felix was extending
>> Felex in a supported fashion instead of 'hacking'
>> Felix with some custom classes).
>>      
>>>
>>>        
>> I would be interested in an improved abstraction for
>> Felix' bundle cache, but I wouldn't want anything
>> too heavyweight. I am not sure how sophisticated/complicated
>> the Apache VFS is, but if it were to add more than just a
>> few classes, it would likely be too much for me. And it also
>> couldn't introduce any dependencies on Java 5 or beyond.
>>
>> Is that do-able? If so, we can definitely talk more about
>> it.
>>
>> ->  richard
>>
>>      
>
>
>
>
>
>
>        
> ------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

Re: Custom BundleCache?

Posted by Ted Stockwell <em...@yahoo.com>.
Hi All,

After thinking about how to customize the system bundle cache, with a eye on not making the base code bigger, it struck me that the simplest thing to do would be to pass a BundleCache implementation in the configuration map that is passed to the Felix construction, as is done for system activators.

So for now I have added this code to the FelixConstants class...
    public static final String SYSTEMBUNDLE_BUNDLE_CACHE
    	= "felix.systembundle.bundle.cache";

and I added this code to the Felix.init method...
// Create the bundle cache, if necessary, so that we can reload any installed bundles.
m_cache= (BundleCache) m_configMutableMap.get(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE);
if (m_cache == null)
{
    try
    {
	m_cache = new BundleCache(m_logger, m_configMap);
    }
    catch (Exception ex)
    {
	m_logger.log(Logger.LOG_ERROR, "Error creating bundle cache.", ex);
	throw new BundleException("Error creating bundle cache.", ex);
    }
}


then in my code I do this....
configMap.put(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE, new Felix4GAEBundleCache());
Felix framework= new Felix(configMap);

I have attached a patch file if you are inclined to apply these changes.


Thanks,
-ted

BTW, I will release felix4gae here, http://code.google.com/p/felix4gae.
I am working on this in the evenings so it will probably take a couple of weeks.






 


--- On Fri, 5/1/09, Richard S. Hall <he...@ungoverned.org> wrote:

> From: Richard S. Hall <he...@ungoverned.org>
> Subject: Re: Custom BundleCache?
> To: users@felix.apache.org
> Date: Friday, May 1, 2009, 12:44 PM
> On 5/1/09 8:37 AM, Ted Stockwell wrote:
> > 
> > Is the custom BundleCache something that the Felix
> group might be interested in merging back into the Felix
> code?  (that's another reason for my asking, it would be
> nice if eventually my custom version of Felix was extending
> Felex in a supported fashion instead of 'hacking'
> Felix with some custom classes).
> >    
> 
> I would be interested in an improved abstraction for
> Felix' bundle cache, but I wouldn't want anything
> too heavyweight. I am not sure how sophisticated/complicated
> the Apache VFS is, but if it were to add more than just a
> few classes, it would likely be too much for me. And it also
> couldn't introduce any dependencies on Java 5 or beyond.
> 
> Is that do-able? If so, we can definitely talk more about
> it.
> 
> -> richard
> 






      

Re: Custom BundleCache?

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 5/1/09 8:37 AM, Ted Stockwell wrote:
> Is there already a standard Felix way of achieving this that I am missing?
>    

No.

> Any other suggestions for customizing bundle caching/loading?
>
> Is the custom BundleCache something that the Felix group might be interested in merging back into the Felix code?  (that's another reason for my asking, it would be nice if eventually my custom version of Felix was extending Felex in a supported fashion instead of 'hacking' Felix with some custom classes).
>    

I would be interested in an improved abstraction for Felix' bundle 
cache, but I wouldn't want anything too heavyweight. I am not sure how 
sophisticated/complicated the Apache VFS is, but if it were to add more 
than just a few classes, it would likely be too much for me. And it also 
couldn't introduce any dependencies on Java 5 or beyond.

Is that do-able? If so, we can definitely talk more about it.

-> richard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Custom BundleCache?

Posted by Ted Stockwell <em...@yahoo.com>.

Hi All,

I am working on getting Felix to run in the Google App Engine.
My goals for this custom version of Felix (felix4gae) are:
1) start any bundles cached in the associated GAE .war folder.
2) be able to cache dynamically installed bundles in the Google DataStore.
3) provide a custom OSGi HTTP service that exposes registered servlets underneath the felix4gae servlet's namespace

I have already finished #3 and I have a quick question regarding #1 and #2.
My plan is to create a custom implementation of org.apache.felix.framework.cache.BundleCache that uses the Apache VFS API to access folders and files instead of the java.io API.
I would then also create a custom Apache VFS file system implementation that works against the Google Datastore.
Finally, all I should have to do is configure the BundleCache to use my custom folder (the folder URL would be something like gds://felix/bundle) and I'm done.

My questions are...

Is there already a standard Felix way of achieving this that I am missing?

Any other suggestions for customizing bundle caching/loading?

Is the custom BundleCache something that the Felix group might be interested in merging back into the Felix code?  (that's another reason for my asking, it would be nice if eventually my custom version of Felix was extending Felex in a supported fashion instead of 'hacking' Felix with some custom classes).


Thanks,
-ted






      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org