You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Angelo (Created) (JIRA)" <ji...@apache.org> on 2012/03/15 11:21:38 UTC

[jira] [Created] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Use Spring DM and Eclipse Gemini Blueprint with DOSGi
-----------------------------------------------------

                 Key: DOSGI-115
                 URL: https://issues.apache.org/jira/browse/DOSGI-115
             Project: CXF Distributed OSGi
          Issue Type: New Feature
          Components: DSW
    Affects Versions: 1.4
         Environment: Developped in Windows OS
            Reporter: Angelo
             Fix For: 1.4


Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
The idea is : 

* 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.List;

import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

/**
 * OSGi Spring container API.
 * 
 * @author Angelo Zerr <an...@gmail.com>
 * 
 */
public interface OsgiSpringContainer {

	/**
	 * Publish the given springs files and returns the Spring
	 * {@link ApplicationContext}.
	 * 
	 * @param springIntentLocations
	 * @param bundleContext
	 * @return
	 */
	ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext);

	/**
	 * Returns the {@link BundleContext} from the given Spring application
	 * context.
	 * 
	 * @param context
	 * @return
	 */
	BundleContext getBundleContext(ApplicationContext context);
}
------------------------------------------------------------------------

1.1) In the class OsgiUtils:

do like this:

------------------------------------------------------------------------
ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
------------------------------------------------------------------------

Instead of doing that: 

------------------------------------------------------------------------
//            
//            
//            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
//                .toArray(new String[] {}));
//            ctx.setPublishContextAsService(false);
//            ctx.setBundleContext(bundleContext);
//            ctx.refresh();
------------------------------------------------------------------------

1.2) In the Activator class: 

Implements ApplicationContextAware (instead of BundleContextAware) : 
public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {

and implements setApplicationContext liek this 

------------------------------------------------------------------------
public void setApplicationContext(ApplicationContext context)
			throws BeansException {
 bc = OsgiUtils.getBundleContext(context);
}
------------------------------------------------------------------------

where OsgiUtils.getBundleContext use the interface 

------------------------------------------------------------------------
public static BundleContext getBundleContext(ApplicationContext context) {
  return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
}: 
------------------------------------------------------------------------

1.1) OsgiSpringContainerProvider:

The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.Iterator;

import javax.imageio.spi.ServiceRegistry;

public class OsgiSpringContainerProvider {

	private static OsgiSpringContainer container;

	public static OsgiSpringContainer getContainer()
			throws OsgiSpringContainerNotFoundException {
		if (container == null) {
			container = getContainerFromFragment();
		}
		return container;
	}

	public static synchronized OsgiSpringContainer getContainerFromFragment()
			throws OsgiSpringContainerNotFoundException {

		if (container != null) {
			return container;
		}
		Iterator<OsgiSpringContainer> containers = ServiceRegistry
				.lookupProviders(OsgiSpringContainer.class,
						OsgiSpringContainerProvider.class.getClassLoader());
		while (containers.hasNext()) {
			return containers.next();
		}
		throw new OsgiSpringContainerNotFoundException();
	}
}
------------------------------------------------------------------------

2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.geminiblueprint;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

public class GeminiBlueprintContainer
		implements OsgiSpringContainer {

	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
		
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}
}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
------------------------------------------------------------------------

This fragment has Eclipse Gemini Blueprint dependencies.

3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.springdm;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;

public class SpringDMContainer implements
		OsgiSpringContainer {

	
	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
	
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}

}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
------------------------------------------------------------------------

This fragment has Spring DM dependencies.

4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint

So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini

5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 

So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm

I don't Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.

Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286608#comment-13286608 ] 

Sergey Beryozkin commented on DOSGI-115:
----------------------------------------

Hi Angelo, I think we'd need to come up with the interface build around the Blueprint concepts, example,

"import org.springframework.context.ApplicationContext;" won't work with Aries.

May be we should introduce two interfaces:
1. org.apache.cxf.dosgi.dsw.container.BlueprintContext
2. org.apache.cxf.dosgi.dsw.container.BlueprintContainer, 
   instead of org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer

   BlueprintContainer would need to return BlueprintContext, and BlueprintContext implementation will delegate to SpringDM, Gemini or Aries application context manager

What do you think ? 
                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286634#comment-13286634 ] 

Sergey Beryozkin commented on DOSGI-115:
----------------------------------------

Yes indeed.
I wonder how the following can be rewritten with Aries:

{code:java}
public BlueprintContext publish(List<String> springIntentLocations,
BundleContext bundleContext) {
OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
springIntentLocations.toArray(new String[] {}));
ctx.setPublishContextAsService(false);
ctx.setBundleContext(bundleContext);
ctx.refresh();
return new AriesBlueprintContext(ctx);
}
{code}

where BlueprintContext and AriesBlueprintContext are DOSGi-specific.

                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider reassigned DOSGI-115:
-----------------------------------------

    Assignee: Christian Schneider
    
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>            Assignee: Christian Schneider
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481303#comment-13481303 ] 

Christian Schneider commented on DOSGI-115:
-------------------------------------------

Do we really need to load a context? I see two better options.

1) We could switch to blueprint and simply add the intentmap to the context that starts the dsw bundle.
2) We could create the intentmap completely in code. It is a bit more work but would make us completely independent of blueprint and spring dm

So I think if we can assume blueprint is always present like e.g. in Karaf 1 is better. If we can not assume this then 2 might be better.
                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Angelo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286627#comment-13286627 ] 

Angelo commented on DOSGI-115:
------------------------------

Hi Sergey,

It's a good idea, but I think we should try to implement Aries in same time to check if it's OK.

Regards Angelo
                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Angelo (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Angelo updated DOSGI-115:
-------------------------

    Attachment: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip

This zip contains 3 Eclipse Projects:

1) cxf-dosgi-ri-dsw-cxf : bundle which has no dependencies to Spring DM.
2) cxf-dosgi-ri-dsw-cxf-gemini :fragment for Eclipse Gemini Blueprint using.
3) cxf-dosgi-ri-dsw-cxf-springdm :fragment for Spring DM using.

If you like this idea, I will create clean patch with pom.xml etc
                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Angelo (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Angelo updated DOSGI-115:
-------------------------

    Description: 
Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
The idea is : 

* 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.List;

import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

/**
 * OSGi Spring container API.
 * 
 * @author Angelo Zerr <an...@gmail.com>
 * 
 */
public interface OsgiSpringContainer {

	/**
	 * Publish the given springs files and returns the Spring
	 * {@link ApplicationContext}.
	 * 
	 * @param springIntentLocations
	 * @param bundleContext
	 * @return
	 */
	ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext);

	/**
	 * Returns the {@link BundleContext} from the given Spring application
	 * context.
	 * 
	 * @param context
	 * @return
	 */
	BundleContext getBundleContext(ApplicationContext context);
}
------------------------------------------------------------------------

1.1) In the class OsgiUtils:

do like this:

------------------------------------------------------------------------
ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
------------------------------------------------------------------------

Instead of doing that: 

------------------------------------------------------------------------
//            
//            
//            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
//                .toArray(new String[] {}));
//            ctx.setPublishContextAsService(false);
//            ctx.setBundleContext(bundleContext);
//            ctx.refresh();
------------------------------------------------------------------------

1.2) In the Activator class: 

Implements ApplicationContextAware (instead of BundleContextAware) : 
public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {

and implements setApplicationContext liek this 

------------------------------------------------------------------------
public void setApplicationContext(ApplicationContext context)
			throws BeansException {
 bc = OsgiUtils.getBundleContext(context);
}
------------------------------------------------------------------------

where OsgiUtils.getBundleContext use the interface 

------------------------------------------------------------------------
public static BundleContext getBundleContext(ApplicationContext context) {
  return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
}: 
------------------------------------------------------------------------

1.1) OsgiSpringContainerProvider:

The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.Iterator;

import javax.imageio.spi.ServiceRegistry;

public class OsgiSpringContainerProvider {

	private static OsgiSpringContainer container;

	public static OsgiSpringContainer getContainer()
			throws OsgiSpringContainerNotFoundException {
		if (container == null) {
			container = getContainerFromFragment();
		}
		return container;
	}

	public static synchronized OsgiSpringContainer getContainerFromFragment()
			throws OsgiSpringContainerNotFoundException {

		if (container != null) {
			return container;
		}
		Iterator<OsgiSpringContainer> containers = ServiceRegistry
				.lookupProviders(OsgiSpringContainer.class,
						OsgiSpringContainerProvider.class.getClassLoader());
		while (containers.hasNext()) {
			return containers.next();
		}
		throw new OsgiSpringContainerNotFoundException();
	}
}
------------------------------------------------------------------------

2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.geminiblueprint;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

public class GeminiBlueprintContainer
		implements OsgiSpringContainer {

	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
		
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}
}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
------------------------------------------------------------------------

This fragment has Eclipse Gemini Blueprint dependencies.

3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.springdm;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;

public class SpringDMContainer implements
		OsgiSpringContainer {

	
	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
	
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}

}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
------------------------------------------------------------------------

This fragment has Spring DM dependencies.

4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint

So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini

5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 

So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm

I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.

Hope you will like it this idea.

  was:
Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
The idea is : 

* 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.List;

import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

/**
 * OSGi Spring container API.
 * 
 * @author Angelo Zerr <an...@gmail.com>
 * 
 */
public interface OsgiSpringContainer {

	/**
	 * Publish the given springs files and returns the Spring
	 * {@link ApplicationContext}.
	 * 
	 * @param springIntentLocations
	 * @param bundleContext
	 * @return
	 */
	ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext);

	/**
	 * Returns the {@link BundleContext} from the given Spring application
	 * context.
	 * 
	 * @param context
	 * @return
	 */
	BundleContext getBundleContext(ApplicationContext context);
}
------------------------------------------------------------------------

1.1) In the class OsgiUtils:

do like this:

------------------------------------------------------------------------
ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
------------------------------------------------------------------------

Instead of doing that: 

------------------------------------------------------------------------
//            
//            
//            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
//                .toArray(new String[] {}));
//            ctx.setPublishContextAsService(false);
//            ctx.setBundleContext(bundleContext);
//            ctx.refresh();
------------------------------------------------------------------------

1.2) In the Activator class: 

Implements ApplicationContextAware (instead of BundleContextAware) : 
public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {

and implements setApplicationContext liek this 

------------------------------------------------------------------------
public void setApplicationContext(ApplicationContext context)
			throws BeansException {
 bc = OsgiUtils.getBundleContext(context);
}
------------------------------------------------------------------------

where OsgiUtils.getBundleContext use the interface 

------------------------------------------------------------------------
public static BundleContext getBundleContext(ApplicationContext context) {
  return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
}: 
------------------------------------------------------------------------

1.1) OsgiSpringContainerProvider:

The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container;

import java.util.Iterator;

import javax.imageio.spi.ServiceRegistry;

public class OsgiSpringContainerProvider {

	private static OsgiSpringContainer container;

	public static OsgiSpringContainer getContainer()
			throws OsgiSpringContainerNotFoundException {
		if (container == null) {
			container = getContainerFromFragment();
		}
		return container;
	}

	public static synchronized OsgiSpringContainer getContainerFromFragment()
			throws OsgiSpringContainerNotFoundException {

		if (container != null) {
			return container;
		}
		Iterator<OsgiSpringContainer> containers = ServiceRegistry
				.lookupProviders(OsgiSpringContainer.class,
						OsgiSpringContainerProvider.class.getClassLoader());
		while (containers.hasNext()) {
			return containers.next();
		}
		throw new OsgiSpringContainerNotFoundException();
	}
}
------------------------------------------------------------------------

2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.geminiblueprint;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;

public class GeminiBlueprintContainer
		implements OsgiSpringContainer {

	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
		
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}
}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
------------------------------------------------------------------------

This fragment has Eclipse Gemini Blueprint dependencies.

3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 

------------------------------------------------------------------------
package org.apache.cxf.dosgi.dsw.container.springdm;

import java.util.List;

import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
import org.osgi.framework.BundleContext;
import org.springframework.context.ApplicationContext;
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;

public class SpringDMContainer implements
		OsgiSpringContainer {

	
	public ApplicationContext publish(List<String> springIntentLocations,
			BundleContext bundleContext) {
		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
				springIntentLocations.toArray(new String[] {}));
		ctx.setPublishContextAsService(false);
		ctx.setBundleContext(bundleContext);
		ctx.refresh();
		return ctx;
	}
	
	public BundleContext getBundleContext(ApplicationContext context) {
		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
	}

}
------------------------------------------------------------------------

This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 

------------------------------------------------------------------------
org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
------------------------------------------------------------------------

This fragment has Spring DM dependencies.

4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint

So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini

5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 

So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm

I don't Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.

Hope you will like it this idea.

    
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DOSGI-115) Use Spring DM and Eclipse Gemini Blueprint with DOSGi

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DOSGI-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schneider resolved DOSGI-115.
---------------------------------------

    Resolution: Fixed

I will switch the loading of intents to a OSGi service aproach in DOSGI-86. As soon as this is done intent loading will also work with Gemini. 
                
> Use Spring DM and Eclipse Gemini Blueprint with DOSGi
> -----------------------------------------------------
>
>                 Key: DOSGI-115
>                 URL: https://issues.apache.org/jira/browse/DOSGI-115
>             Project: CXF Distributed OSGi
>          Issue Type: New Feature
>          Components: DSW
>    Affects Versions: 1.4
>         Environment: Developped in Windows OS
>            Reporter: Angelo
>            Assignee: Christian Schneider
>              Labels: patch
>             Fix For: 1.4
>
>         Attachments: cxf-dosgi-ri-dsw-Eclipse Projects cxf with Spring DM+Eclipse Gemini Blueprint.zip
>
>
> Today cxf-dosgi-ri-dsw-cxf supports only Spring DM. This goal of this issue is to modify cxf-dosgi-ri-dsw-cxf to support both Spring DM and Eclipse Gemini Blueprint.
> The idea is : 
> * 1) cxf-dosgi-ri-dsw-cxf :remove Spring DM dependencies (don't use directly org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext and org.springframework.osgi.context.BundleContextAware) in this project but use a commons interface :
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.List;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> /**
>  * OSGi Spring container API.
>  * 
>  * @author Angelo Zerr <an...@gmail.com>
>  * 
>  */
> public interface OsgiSpringContainer {
> 	/**
> 	 * Publish the given springs files and returns the Spring
> 	 * {@link ApplicationContext}.
> 	 * 
> 	 * @param springIntentLocations
> 	 * @param bundleContext
> 	 * @return
> 	 */
> 	ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext);
> 	/**
> 	 * Returns the {@link BundleContext} from the given Spring application
> 	 * context.
> 	 * 
> 	 * @param context
> 	 * @return
> 	 */
> 	BundleContext getBundleContext(ApplicationContext context);
> }
> ------------------------------------------------------------------------
> 1.1) In the class OsgiUtils:
> do like this:
> ------------------------------------------------------------------------
> ApplicationContext ctx = OsgiSpringContainerProvider.getContainer().publish(springIntentLocations, bundleContext);
> ------------------------------------------------------------------------
> Instead of doing that: 
> ------------------------------------------------------------------------
> //            
> //            
> //            OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(springIntentLocations
> //                .toArray(new String[] {}));
> //            ctx.setPublishContextAsService(false);
> //            ctx.setBundleContext(bundleContext);
> //            ctx.refresh();
> ------------------------------------------------------------------------
> 1.2) In the Activator class: 
> Implements ApplicationContextAware (instead of BundleContextAware) : 
> public class Activator implements ManagedService, ApplicationContextAware/*,BundleContextAware*/ {
> and implements setApplicationContext liek this 
> ------------------------------------------------------------------------
> public void setApplicationContext(ApplicationContext context)
> 			throws BeansException {
>  bc = OsgiUtils.getBundleContext(context);
> }
> ------------------------------------------------------------------------
> where OsgiUtils.getBundleContext use the interface 
> ------------------------------------------------------------------------
> public static BundleContext getBundleContext(ApplicationContext context) {
>   return OsgiSpringContainerProvider.getContainer().getBundleContext(context);
> }: 
> ------------------------------------------------------------------------
> 1.1) OsgiSpringContainerProvider:
> The OsgiSpringContainerProvider use SPI ServiceRegistry to retrieves the implemententation of OsgiSpringContainer  : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container;
> import java.util.Iterator;
> import javax.imageio.spi.ServiceRegistry;
> public class OsgiSpringContainerProvider {
> 	private static OsgiSpringContainer container;
> 	public static OsgiSpringContainer getContainer()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container == null) {
> 			container = getContainerFromFragment();
> 		}
> 		return container;
> 	}
> 	public static synchronized OsgiSpringContainer getContainerFromFragment()
> 			throws OsgiSpringContainerNotFoundException {
> 		if (container != null) {
> 			return container;
> 		}
> 		Iterator<OsgiSpringContainer> containers = ServiceRegistry
> 				.lookupProviders(OsgiSpringContainer.class,
> 						OsgiSpringContainerProvider.class.getClassLoader());
> 		while (containers.hasNext()) {
> 			return containers.next();
> 		}
> 		throw new OsgiSpringContainerNotFoundException();
> 	}
> }
> ------------------------------------------------------------------------
> 2) cxf-dosgi-ri-dsw-cxf-gemini : new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the Gemini BluePring implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.geminiblueprint;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> public class GeminiBlueprintContainer
> 		implements OsgiSpringContainer {
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 		
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.geminiblueprint.GeminiBlueprintContainer
> ------------------------------------------------------------------------
> This fragment has Eclipse Gemini Blueprint dependencies.
> 3) cxf-dosgi-ri-dsw-cxf-springdm: new project which is a fragment linked to cxf-dosgi-ri-dsw-cxf and register with SPI ServiceRegistry the SppringDM implementation of OSgiSpringContainer : 
> ------------------------------------------------------------------------
> package org.apache.cxf.dosgi.dsw.container.springdm;
> import java.util.List;
> import org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer;
> import org.osgi.framework.BundleContext;
> import org.springframework.context.ApplicationContext;
> import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
> public class SpringDMContainer implements
> 		OsgiSpringContainer {
> 	
> 	public ApplicationContext publish(List<String> springIntentLocations,
> 			BundleContext bundleContext) {
> 		OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(
> 				springIntentLocations.toArray(new String[] {}));
> 		ctx.setPublishContextAsService(false);
> 		ctx.setBundleContext(bundleContext);
> 		ctx.refresh();
> 		return ctx;
> 	}
> 	
> 	public BundleContext getBundleContext(ApplicationContext context) {
> 		return ((OsgiBundleXmlApplicationContext)context).getBundleContext();
> 	}
> }
> ------------------------------------------------------------------------
> This implementation is registered in the file META-INF/services/org.apache.cxf.dosgi.dsw.container.OsgiSpringContainer : 
> ------------------------------------------------------------------------
> org.apache.cxf.dosgi.dsw.container.springdm.SpringDMContainer
> ------------------------------------------------------------------------
> This fragment has Spring DM dependencies.
> 4) Use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint
> So to use cxf-dosgi-ri-dsw-cxf with Eclipse Gemini Blueprint, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-gemini
> 5) Use cxf-dosgi-ri-dsw-cxf with Spring DM 
> So to use cxf-dosgi-ri-dsw-cxf with Spring DM, add in the OSGi container cxf-dosgi-ri-dsw-cxf+cxf-dosgi-ri-dsw-cxf-springdm
> I don't know Gemini Aires, but if it is based on Spring, we could create a new fragment cxf-dosgi-ri-dsw-cxf-aires.
> Hope you will like it this idea.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira