use of org.apache.felix.connect.launch.PojoServiceRegistry in project karaf by apache.
the class EncryptablePropertyPlaceholderTest method setUp.
@Before
public void setUp() throws Exception {
StandardPBEStringEncryptor enc = new StandardPBEStringEncryptor();
EnvironmentStringPBEConfig env = new EnvironmentStringPBEConfig();
env.setAlgorithm("PBEWithMD5AndDES");
env.setPassword("password");
enc.setConfig(env);
String val = enc.encrypt("bar");
System.setProperty("foo", val);
System.setProperty("org.bundles.framework.storage", "target/bundles/" + System.currentTimeMillis());
System.setProperty("karaf.name", "root");
List<BundleDescriptor> bundles = new ClasspathScanner().scanForBundles("(Bundle-SymbolicName=*)");
bundles.add(getBundleDescriptor("target/jasypt.jar", bundle().add("OSGI-INF/blueprint/karaf-jaas-jasypt.xml", getClass().getResource("/OSGI-INF/blueprint/karaf-jaas-jasypt.xml")).set("Manifest-Version", "2").set("Bundle-ManifestVersion", "2").set("Bundle-SymbolicName", "jasypt").set("Bundle-Version", "0.0.0")));
bundles.add(getBundleDescriptor("target/test.jar", bundle().add("OSGI-INF/blueprint/test.xml", getClass().getResource("test.xml")).set("Manifest-Version", "2").set("Bundle-ManifestVersion", "2").set("Bundle-SymbolicName", "test").set("Bundle-Version", "0.0.0")));
Map config = new HashMap();
config.put(PojoServiceRegistryFactory.BUNDLE_DESCRIPTORS, bundles);
PojoServiceRegistry reg = new PojoServiceRegistryFactoryImpl().newPojoServiceRegistry(config);
bundleContext = reg.getBundleContext();
}
use of org.apache.felix.connect.launch.PojoServiceRegistry in project jackrabbit-oak by apache.
the class WebConsoleSupport method postConstruct.
@PostConstruct
private void postConstruct() throws Exception {
PojoServiceRegistry reg = ((ServiceRegistryProvider) repository).getServiceRegistry();
//Configure repository backed SecurityProvider
reg.registerService(WebConsoleSecurityProvider.class.getName(), new RepositorySecurityProvider(), null);
//Expose the Spring Application context to Script Console access
reg.registerService(ApplicationContext.class.getName(), context, null);
}
Aggregations