List Info

Thread: Extension Points vs. Declarative Services




Extension Points vs. Declarative Services
user name
2006-11-08 16:50:58

Hello,

 

I have a few questions with regards to the NuxeoRuntime

 

I see that NuxeoRuntime supports extension points which from what I can see are not a standard / defined in the OSGI R4 specification.  It looks as though this feature is modeled after Eclipse concept of an extension point except I do not see how to define / declare an extension point an associate it with a specific interface, is this possible?  I would guess it is just a matter of including it in the handler of the extension point?

 

Also is there a time frame on when Declarative Services will be supported by NuxeoRuntime?

 

Finally, we have a need to support other application servers, OC4J and WebLogic, in the near future.  Is there an example or document on what needs to be done to create an adapter for another platform; or any suggestions based on the JBoss implementation?

 

TIA for your assistance.

 

Regards,

Todd

 

 

Extension Points vs. Declarative Services
user name
2006-11-08 17:16:59
Todd Nist wrote:
>
> Hello,
>
>  
>
> I have a few questions with regards to the NuxeoRuntime
>
>  
>
> I see that NuxeoRuntime supports extension points which
from what I 
> can see are not a standard / defined in the OSGI R4
specification.  It 
> looks as though this feature is modeled after Eclipse
concept of an 
> extension point except I do not see how to define /
declare an 
> extension point an associate it with a specific
interface, is this 
> possible?  I would guess it is just a matter of
including it in the 
> handler of the extension point?
>
>  
>
In NXRuntime the main concept is the component - that
usually is defined 
through XML descriptors.
A component is close to an OSGi declarative service but
doesn't yet 
implements all OSGi specs.
Because in our application we need very flexible components
that can be 
extended/configured by other components from outside - this
means 
without changing
the component descriptor or the bundle that contains the
component 
descriptor - we added to a component the capability to
declare extension 
points.
The use of extension points was inspired from eclipse (we've
developed 
in past several eclipse based projects) but it's different
in 
implementation.
Extension points can be declared only by components. They
represents 
aspects of a component that can be configured from outside.
The component is responsible to register extensions
contributed for each 
of its declared extension points.
An extension point or an extension is not a physical java
object. There 
is no interface that can be implemented to define new
extension points.
Extension points from user point of view are string
identifiers of 
aspects that can be configured from outside on a component.
For example a component named org.nuxeo.ecm.TypeManager may
declare an 
extension point "types" which can be used to
register new document types.
The component implementation is responsible to do something
when it 
receive a new extension for this extension point through the

Component.registerExtension(Extension extension) method

Extension data is stored as XML DOM element. The Component
should be 
able to parse this and to create and register the objects
defined by 
this XML fragment or to do some action.
You can also use XMap to automatically map the DOM element
to a Java 
object (using java annotations). This way you don't need to
parse the 
DOM element and you can directly get java objects
that describe the extension.

The extension data is not restricted to any XML schema like
in eclipse. 
You can put anything inside an extension. If the component
will not 
recognize the extension format it will do nothing with.
There is not yet a method to check extension format
integrity.

Anyway using XMap registering extensions is quite
straightforward.

So, all the logic is implemented in the Component
implementation. You 
don't need to define new objects that handle each extension
point.
Most of the components will have only one extension point so
I think it 
is simpler for the programmer to put the logic of
registering extension 
inside the component itself.

Here is an example of how an extension is registered by a
component: 
(here XMap is used)


    public void registerExtension(Extension extension) {
        String xp = extension.getExtensionPoint();
        if ("doctype".equals(xp)) {
            Object[] contribs =
extension.getContributions();
            for (Object contrib : contribs) {
                
typeManager.registerDocumentType((DocumentTypeDescriptor)con
trib);
            }
        } else if ("schema".equals(xp)) {
            Object[] contribs =
extension.getContributions();
            for (Object contrib : contribs) {
                try {
                    // use the context of the bundle
contributing the 
extension
                    // to load schemas
                    SchemaBindingDescriptor sbd = 
(SchemaBindingDescriptor)contrib;
                    sbd.context =
extension.getComponent().getContext();
                    registerSchema(sbd);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

This is a method which register extensions for 2 extension
points 
declared by the component: "doctype" and
"schema"
>
> Also is there a time frame on when Declarative Services
will be 
> supported by NuxeoRuntime?
>
You can find a rodmap here http://w
ww.nuxeo.org/sections/about/roadmap/
Until april 2007 we plan to support OSGi declarative
services.
>
>  
>
> Finally, we have a need to support other application
servers, OC4J and 
> WebLogic, in the near future.  Is there an example or
document on what 
> needs to be done to create an adapter for another
platform; or any 
> suggestions based on the JBoss implementation?
>
Unfortunately we haven't a document which explain this - for
now the 
only source of information is this list or you can directly
contact me 
for help.
We also plan to port NXRuntime on various app servers but
for now we 
focus on JBoss since our main product requires it.
Thanks for your interest in NXRuntime, you are welcome if
you want to 
contribute on NXRuntime for adding new features or adapting
it on other 
app servers-  we will help you with any information you
need, and 
support you as much as possible.
>
>  
>
> TIA for your assistance.
>
>  
>
> Regards,
>
> Todd
>
>  
>
>  
>
>
------------------------------------------------------------
------------
>
> _______________________________________________
> ECM mailing list
> ECMlists.nuxeo.com
> http://li
sts.nuxeo.com/mailman/listinfo/ecm
>   


-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/
- http://www.nuxeo.com/en

_______________________________________________
ECM mailing list
ECMlists.nuxeo.com
http://li
sts.nuxeo.com/mailman/listinfo/ecm
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )