felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Felix - File Install
Date Wed, 02 Feb 2011 15:55:01 GMT
On 2/2/11 10:36, Muller, Anthony wrote:
> Hello,
>
> I'm trying to use FileInstall but it doesn't work :-/
>
> I wrote an eclipse project with an only dependency with Felix.
>
> I put "org.apache.felix.fileinstall-3.1.4.jar" in a "bundles" directory and this one
is properly deploy by Felix.
>
> But I cannot configure FileInstall to manage a "dropins" directory in order to automatically
start bundles present here.
>
> Thanks for help,
> Anthony
>
>
> public class FelixLauncher {
>
> 	private final HostActivator activator = new HostActivator();
>
> 	private Framework felix;
>
> 	public FelixLauncher() {
> 		// Create a configuration property map.
> 		final Map<Object, Object>  configMap = new HashMap<Object, Object>();
>
> 		// Create host activator;
> 		final List<Object>  list = new ArrayList<Object>();
> 		list.add(activator);
> 		configMap.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list);
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_DIR_PROPERY, "bundles");
> 		configMap.put(AutoProcessor.AUTO_DEPLOY_ACTION_PROPERY, AutoProcessor.AUTO_DEPLOY_INSTALL_VALUE);

You are only telling the auto-deploy mechanism to install bundles, you 
want to set the value to "install, start" so that it installs and starts 
the auto-deploy bundles.

-> richard

> 		try {
> 			felix = new Felix(configMap);
> 			felix.init();
>
> 			AutoProcessor.process(configMap, felix.getBundleContext());
>
> 			felix.start();
>
> 			Bundle[] bnds = felix.getBundleContext().getBundles();
> 			for (Bundle bundle : bnds) {
> 				bundle.start();
> 				System.out.println(bundle + " : " + bundle.getState());
> 			}
> 		} catch (Exception ex) {
> 			ex.printStackTrace();
> 		}
> 	}
>
> 	public Framework getFramework() {
> 		return felix;
> 	}
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message