[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] OSGi for Server-side...

Sounds neat. The main issue I see is the exchange of URL objects with 
something on the parent classpath (eg. URLClassLoader) which will result 
in an error if each framework instance generates its own version of the 
URL class for its bundles. This is a general problem with creating private 
versions of base classes.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
Office: +1 407 849 9117 Mobile: +1 386 848 3788

Olivier Gruber/Watson/IBM@IBMUS 
Sent by: equinox-dev-bounces@xxxxxxxxxxx
2005-10-25 10:22 AM
Please respond to
Equinox development mailing list

Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

Re: [equinox-dev] OSGi for Server-side...

Just as an idea and testing the reactions... :-) 

We can look at solving the problem... or we can look at avoiding the 
One possible way to avoid the problem is not use the JRE URL subsystem. 
I don't have all the details worked out, but just the overall idea... 

For this to work, we would have to weave/refactor class files at 
deployment or loading time. 
We would need our own URL framework that is binary compatible with the JRE 
or with a straight mapping (like straightforward refactoring). This means 
that no one would be 
using the JRE URL framework, although they think they are. 

This would always allow us to have control over the 
It would be our own. For all code executing within the OSGi environment 
This would require having some access to the other jars as well... so that 
they can be 
woven as well. Only the JRE rt.jar and the like would be left alone. 

Any reaction? 
Do we have other similar issues that could be addressed through bytecode 
Best regards, 

Olivier Gruber, Ph.D.
Persistent & Distributed Object Platforms and Frameworks
IBM TJ Watson Research Center

Thomas Watson/Austin/IBM@IBMUS 
Sent by: equinox-dev-bounces@xxxxxxxxxxx 
10/25/2005 03:46 PM 
Please respond to Equinox development mailing list 
        To:        Equinox development mailing list 
        Subject:        Re: [equinox-dev] OSGi for Server-side...

> On Tuesday 25 October 2005 14:28, Kaegi, Simon wrote:
> > 1) Running when someone else has set the URL and URLConnection 
> > needed by the URLHandlerService - patched but needs polishing
> Big problem without co-operation from the "conflictee". However, more 
> importantly, how about when loading many Equinox instances in the same 
> and resolving the URLHandler issue across those... Richard hall is 
> on this problem, and I think collaboration is a good thing here.

Yes collaboration is good here.  I have spent time discussing this problem 

and possible solutions with Richard Hall.  The current solution Richard 
is implementing in Felix is likely the best we can do for this situation. 
Unfortunately the solutions is pretty complex and I would definitely only 
to enable it if more than one framework is running in the VM. 

There is still a problem with Richard's solution, because it still assumes 

the Framework can set the singleton URLStreamHandlerFactory for the VM. In 

Simon's case we want the core framework to still function 
when setting the URLStreamHandlerFactory fails and therefore the 
URLHandlerService is unavailable. 

> > 2) Using the Conditional Permission Admin Service when someone else 
has set
> > the SecurityManager. - avoided this so far but it's an important
> > consideration in some server-side environments - without control of 
> > SecurityManager we lose the capability to do postponed decisions (?) - 
> > are the repercussions? Is there something we can do about it?
> Two things comes to mind;
>  1. User can specify the SecurityManager from commandline, and if an 
> application doesn't do the selective setting of the SM, then that is a 
> If you can convince the deployment team that the SM from Equinox does a 
> better job than the "default" one, then mission accompilshed. (provided 
> technical difficulties to have the SM separated out bla bla bla...)

Here are the technical difficulties: 
- The SecurityManager specified at commandline must be available on the 
application classloader or its parent classloaders (i.e. ext, boot). 
When Equinox is launched the code for the framework is loaded with a 
classloader (not the app classloader) so it's security manager cannot 
be specified at commandline. 
- Moving the FrameworkSecurityManager out of the core framework.  This has 

issues because it uses some core OSGi interfaces 
(e.g. org.osgi.service.condpermadmin.Condition).  These classes would also 

have to be separated from the framework.  This is not good situation IMO. 

>  2. If the deployer decides to stick with the default security, 
> shouldn't this 
> "just work" for Equinox as well?? Not sure, what to put in the security 
> policy codebase URLs, but shouldn't be impossible. 

OSGi actually assumes complete control here.  Each bundle in OSGi has a 
ProtectionDomain.  This ProtectionDomain is controlled by the Framework 
and dictates what permissions a class loaded from a bundle will have. When 

the Framework defines a class it specifies the correct bundle 
depending on what bundle the class bytes came form.  The bundle 
ProtectionDomain uses a policy to assign permissions based on input from 
PermissionAdmin and ConditionalPermissionAdmin services defined by the 
specification.  No other policy is used to assign permissions to a 
ProtectionDomain.  Regardless of what SecurityManager is used the 
ProtectionDomain for the Class being check is what defines the permissions 

a particular class gets granted. 

The only reason a "special" FrameworkSecurityManager is needed is to 
postponed conditions correctly.  In Equinox we detect this situation and 
treat all postponed conditions as non-postponed conditions if the 
SecurityManager is not our own "special" implementation.  What we have to 
decide is if we care about postponed conditions in the scenarios we 
are trying to run in. 

> Cheers
> Niclas 

equinox-dev mailing list
equinox-dev mailing list