[JBoss OSGi Development] - Re: Proper system BundleContext implementation
by adrian@jboss.org
The issue is not really that, it is what we were talking about on the other thread.
The system bundle is not a real deployment, it effectively represents the bootstrap
classloader so it needs to adopt that classloader and use it where the deployment
gets used.
This is what 3.4 calls the "Framework Classpath".
But there are other considerations in the spec such as;
3.8.3 - Parent Delegation - which is actually already worked around by the JDKProvider stuff
3.8.5 - System packages
3.14 - Extension Bundles - although they are optional in the spec
If you want to factor out the common code into an AbstractBundleState rather than
having OSGiSystemBundle extend OSGiBundleState then go ahead, but do
it quickly. ;-)
I'm currently looking at the manifest parsing so you are not going to break what
I'm working on.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251776#4251776
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251776
15 years, 4 months
[JBoss OSGi Development] - Re: HOWTO chage the behaviour of the CL policy
by adrian@jboss.org
So let's do it the same way. I haven't really looked at this part of the spec yet
but its certainly something I planned to address.
There's no reason why the SystemBundle classloader couldn't be defined in the
bootstrap to expose the osgi core packages (and maybe some services)
instead of letting them bubble up to the "classpath" using the parent policy.
The other services would just be deployed as bundles.
i.e. just make the parent policy in OSGiClassLoaderSystem
ParentPolicy.BEFORE_BUT_JAVA_ONLY
then have the following in the bootstrap.xml to be the "system bundle classloader"
| <deployment xmlns="urn:jboss:bean-deployer:2.0">
|
| <classloader><inject bean="system-bundle:4.4.2" /></classloader>
|
| <classloader name="system-bundle"
| version="4.4.2"
| xmlns="urn:jboss:classloader:1.0"
| >
| <root>${jboss.lib.url}osgi-core.jar</root>
| <root>${jboss.lib.url}jboss-osgi-impl.jar</root>
| <capabilities>
| <package name="org.osgi.framework" version="1.4.0"/>
| <package name="org.osgi.service.packageadmin" version="1.2.0"/>
| <etc./>
| </capabilities>
| </classloader>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251749#4251749
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251749
15 years, 4 months
[JBoss OSGi Development] - Re: Change in manifest parser breaks symbolic name
by adrian@jboss.org
The parsing of ParameterAttribute(s) and its decendent classes was already broken. The issue is in the javacc generated code.
The change I made was to parse the BundleSymbolicName as a ParameterAttribute
instead of a plain string because it has directives and attributes, e.g.
Bundle-Symbolic-Name=foo.bar;singleton=true
The reason is that the grammer is ambigous so sometimes it thinks it is parsing a PATH
when it should be parsing a QNAME.
The "tokenizer" part of the code is generating a wrong token and then it fails to match
in the parsing.
There's a commented out test with a TODO in the package import testing because of this.
Fixing this parsing problem is on my list of things to fix.
P.S. This is an "anti-pattern"
| public String getBundleSymbolicName()
| {
|
| <snip/>
|
| if (symbolicName == null)
| throw new IllegalStateException("Cannot obtain " + Constants.BUNDLE_SYMBOLICNAME);
|
| return symbolicName;
| }
|
You shouldn't put validation logic in the metadata model.
This validation of the model should be done when we are asked to install the bundle
so that others can augment/vary the model.
e.g. you could imagine a custom deployer that does for example
| OSGiMetaData md = ...;
| if (md.getBundleSymbolicName() == null)
| // generate one
|
Instead your validation in the getter would mean it has to catch the exception which is counter intuitive.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251737#4251737
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251737
15 years, 4 months