Hi David,

That is what I thought, but take a look at the following extract of the
exportService(...) implemented in RemoteServiceAdminCore class:

public List exportService(ServiceReference serviceReference, Map
additionalProperties) ... {

       ...
            // Get the intents that need to be supported by the RSA
            String[] requiredIntents =
Utils.getAllRequiredIntents(serviceProperties);

            {
                IntentMap im = OsgiUtils.getIntentMap(bctx);

                List<String> unsupportedIntents = new ArrayList<String>();

                for (String ri : requiredIntents) {
                    if (!im.getIntents().containsKey(ri)) {
                        unsupportedIntents.add(ri);
                    }
                }

                if (unsupportedIntents.size() > 0) {
                    LOG
                        .severe("service cannot be exported because the
following intents are not supported by this RSA: "
                                + unsupportedIntents);
                    // TODO: publish error event
                    return Collections.EMPTY_LIST;
                }

            }

As you can see here, the export method tries to check whether the required
intents are supported by the Distribution Provider(DP). To do that, it reads
the DP's intent-map (IntentMap im = OsgiUtils.getIntentMap(bctx), bctx is
the case is bundle cxf-dosgi-ri-dsw-cxf's context) and checks if the
required intents are contained there. If they are not, DP doesn´t export the
service and just returns an empty list. So, I guess that we can't export a
service if it requires an intent that is not supported by the DP directly.
In fact, I tried that and it didn't work.

And David, about our previous conversation (previous emails), I guess that
maybe I would use some client's container to build that client's timer
(something like an iPojo's handler), what do you think about?

Thank you, again!

cheers,

Fábio

On Thu, Oct 28, 2010 at 3:21 AM, David Bosschaert <
[email protected]> wrote:

> Hi Fabio,
>
> Yes, you should be able to include the intent-map.xml file in your own
> bundle. Your bundle shouldn't have to be a fragment for that. The
> intent map that is part of the distro is the default intent map and
> the one in your bundle is specific to your application, so it
> overrides the default.
>
> Does this answer your question?
>
> Cheers,
>
> David
>
> On 27 October 2010 15:53, Fabio souza <[email protected]>
> wrote:
> > Hi everybody,
> >
> > I have a doubt corcerning the mecanism to include intents in CXF/DOSGi
> > implementation. To create a new intent I had to modify the intent-map
> file
> > that is included in DOSGi distribution. Is this the right approach?
> >
> > Well, let me detail a bit more what I did. I created a bundle called
> > Monitor.jar to contain my extensions (new intents). Basically, that
> bundle
> > contains the feature and the interceptors that implement the intents.
> >
> > To make spring understand my new intents, I followed spring instructions
> and
> > did the following:
> >
> > 1. Authored an XML schema to describe my custom elements and included
> that
> > schema in my bundle (schemas/monitoring.xsd).
> > 2. Coded a custom NamespaceHandler implementation that parses my elements
> > which represent my intents in the intent-map file.
> > 3. Registered the above artifacts with Spring in order to make it aware
> of
> > my custom elements. To do that I included META-INF/spring.handlers and
> > META-INF/spring.schemas files in my bundle.
> >
> > So far, so good. However, in order to use those intents, I had to modify
> the
> > intent-map.xml file stored in cxf-dosgi-ri-dsw-cxf-<xxx>.jar bundle:
> >
> > <beans xmlns="http://www.springframework.org/schema/beans";
> >       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >       xmlns:p="http://cxf.apache.org/policy";
> >       xmlns:wsp="http://www.w3.org/ns/ws-policy";
> >       xmlns:wsu="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> > "
> >       xmlns:core="http://cxf.apache.org/core";
> >  xmlns:monitoring="http://br.ufpe.cin.dynaserv/monitoring";
> >       xmlns:soap="http://cxf.apache.org/bindings/soap";
> >       xsi:schemaLocation="
> >       http://cxf.apache.org/policy
> http://cxf.apache.org/schemas/policy.xsd
> >       http://www.w3.org/ns/ws-policy
> > http://www.w3.org/2007/02/ws-policy.xsd
> >       http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
> >  http://br.ufpe.cin.dynaserv/monitoring
> > http://br.ufpe.cin.dynaserv/monitoring.xsd
> >       http://cxf.apache.org/bindings/soap
> > http://cxf.apache.org/schemas/configuration/soap.xsd
> >       http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans.xsd";>
> >   <bean id="intentMap" class="org.apache.cxf.dosgi.dsw.qos.IntentMap">
> >      <property name="intents">
> >        <map>
> >          <entry key="addressing" value-ref="nonDecoupledAddressing"/>
> >          <entry key="logging" value-ref="messageLogging"/>
> >          <entry key="timer" value-ref="timerId"/>
> >          <entry key="SOAP" value-ref="soap11Binding"/>
> >          <entry key="SOAP.1_1" value-ref="soap11Binding"/>
> >          <entry key="SOAP.1_2" value-ref="soap12Binding"/>
> >          <entry key="HTTP" value="PROVIDED"/>
> >        </map>
> >      </property>
> >   </bean>
> >
> >   <p:policies id="nonDecoupledAddressing">
> >       <wsp:PolicyReference URI="#AddressingPolicy"/>
> >   </p:policies>
> >
> >   <wsp:Policy wsu:Id="AddressingPolicy"
> >       xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata";>
> >       <wsam:Addressing>
> >           <wsp:Policy />
> >       </wsam:Addressing>
> >   </wsp:Policy>
> >
> >   <core:logging id="messageLogging"/>
> >
> >      <monitoring:timer id="timerId"/>
> >
> >   <soap:soapBinding id="soap11Binding" version="1.1"/>
> >   <soap:soapBinding id="soap12Binding" version="1.2"/>
> >
> > </beans>
> >
> > Well, it wasn't difficult, but I thought that I would be able to include
> > that intent-map file in my own bundle (which could be a fragment of the
> > DOSGi one). Could you  please comment on this point? I am not sure
> whether I
> > was clear, but fell free to ask me anything about it.
> >
> > Thank you very much!
> >
> > --
> > Fábio
> >
>



-- 
Fábio

Reply via email to