This project has retired. For details please refer to its
Attic page.
Activator xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.client.osgi;
2021import java.util.Dictionary;
22import java.util.Hashtable;
2324import org.apache.chemistry.opencmis.client.api.SessionFactory;
25import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
26import org.osgi.framework.BundleActivator;
27import org.osgi.framework.BundleContext;
28import org.osgi.framework.Constants;
2930/**31 * OSGi Bundle activator for the OpenCMIS client which registers an instance of32 * the {@link SessionFactory} in the OSGi service registry.33 */34publicclassActivator implements BundleActivator {
3536publicvoid start(BundleContext context) throws Exception {
37// register the MetaTypeService now, that we are ready38 Dictionary<String, String> props = new Hashtable<String, String>();
39 props.put(Constants.SERVICE_DESCRIPTION, "Apache Chemistry OpenCMIS Client Session Factory");
40 props.put(Constants.SERVICE_VENDOR, "Apache Software Foundation");
4142 SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
43 context.registerService(SessionFactory.class.getName(), sessionFactory, props);
44 }
4546publicvoid stop(BundleContext context) throws Exception {
47// The SessionFactory service will be unregistered automatically48 }
49 }