private void registerGraphAsService(IRI name, boolean isMGraph) { Dictionary<String,Object> props = new Hashtable<String, Object>(); props.put("name", name.getUnicodeString()); String[] interfaceNames; Object service; if (isMGraph) { interfaceNames = new String[]{ Graph.class.getName(), Graph.class.getName() }; service = new MGraphServiceFactory(this, name, tcAccessController); } else { interfaceNames = new String[]{ImmutableGraph.class.getName()}; service = new ImmutableGraphServiceFactory(this, name, tcAccessController); } final int bundleState = componentContext.getBundleContext().getBundle().getState(); if ((bundleState == Bundle.ACTIVE) || (bundleState == Bundle.STARTING)) { ServiceRegistration serviceReg = componentContext.getBundleContext() .registerService(interfaceNames, service, props); serviceRegistrations.put(name, serviceReg); } }
private void registerGraphAsService(IRI name, boolean isMGraph) { Dictionary<String,Object> props = new Hashtable<String, Object>(); props.put("name", name.getUnicodeString()); String[] interfaceNames; Object service; if (isMGraph) { interfaceNames = new String[]{ Graph.class.getName(), Graph.class.getName() }; service = new MGraphServiceFactory(this, name, tcAccessController); } else { interfaceNames = new String[]{ImmutableGraph.class.getName()}; service = new ImmutableGraphServiceFactory(this, name, tcAccessController); } final int bundleState = componentContext.getBundleContext().getBundle().getState(); if ((bundleState == Bundle.ACTIVE) || (bundleState == Bundle.STARTING)) { ServiceRegistration serviceReg = componentContext.getBundleContext() .registerService(interfaceNames, service, props); serviceRegistrations.put(name, serviceReg); } }