use of org.apache.chemistry.opencmis.client.api.SessionFactory in project camel by apache.
the class SessionFactoryLocator method loadSessionFactoryFromClassPath.
private static SessionFactory loadSessionFactoryFromClassPath() {
try {
Class<?> factoryClass = null;
factoryClass = Class.forName("org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl");
if (factoryClass != null) {
Method method = factoryClass.getMethod("newInstance", new Class<?>[0]);
return (SessionFactory) method.invoke(null, new Object[0]);
}
} catch (Exception ex) {
LOG.error("Cannot create the SessionFactoryImpl due to: {0}", ex);
throw new RuntimeCamelException(ex);
}
return null;
}
use of org.apache.chemistry.opencmis.client.api.SessionFactory in project camel by apache.
the class Activator method start.
@Override
public void start(BundleContext context) throws Exception {
// get the reference of SessionFactory service
reference = context.getServiceReference(SessionFactory.class.getName());
SessionFactory sessionFactory = (SessionFactory) context.getService(reference);
SessionFactoryLocator.setSessionFactory(sessionFactory);
}
use of org.apache.chemistry.opencmis.client.api.SessionFactory in project camel by apache.
the class CMISTestSupport method createSession.
protected Session createSession() {
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.ATOMPUB_URL, getUrl());
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
Repository repository = sessionFactory.getRepositories(parameter).get(0);
return repository.createSession();
}
Aggregations