private Set<SbbEntityID> retrieveAllSbbEntitiesIds() throws SystemException, NullPointerException, ManagementException, NotSupportedException { Set<SbbEntityID> result = new HashSet<SbbEntityID>(); for (ServiceID serviceID : sleeContainer.getServiceManagement().getServices(ServiceState.ACTIVE)) { try { for (SbbEntityID rootSbbId : sbbEntityFactory.getRootSbbEntityIDs(serviceID)) { result.addAll(getChildSbbEntities(rootSbbId)); } } catch (Exception e) { // ignore } } return result; }
public ServiceActivityContextInterfaceFactory getServiceActivityContextInterfaceFactory() { return sleeContainer.getServiceManagement().getServiceActivityContextInterfaceFactory(); }
public ServiceActivityFactory getServiceActivityFactory() { return sleeContainer.getServiceManagement().getServiceActivityFactory(); }
@Override public void invoke() throws Exception { ServiceID oldVersion = null; for (ServiceID activeService : getServiceManagement().getServices( ServiceState.ACTIVE)) { if (activeService.getName().equals(getServiceID().getName()) && activeService.getVendor().equals( getServiceID().getVendor())) { oldVersion = activeService; break; } } if (oldVersion == null) { getServiceManagement().activate(getServiceID()); } else { getServiceManagement().deactivateAndActivate(oldVersion, getServiceID()); } }
@Override public void invoke() throws Exception { final ServiceManagement serviceManagement = getServiceManagement(); final ServiceComponent serviceComponent = serviceManagement.getSleeContainer().getComponentRepository().getComponentByID(getServiceID()); if (serviceComponent != null) { // deactivate if needed if (serviceComponent.getServiceState() == ServiceState.ACTIVE) { serviceManagement.deactivate(getServiceID()); } // continue once service is inactive while(serviceComponent.getServiceState() != ServiceState.INACTIVE) { try { Thread.sleep(1000); } catch (Exception e) { // ignore } } } }
sleeContainer.getServiceManagement().getServiceActivityContextInterfaceFactory()); } catch (NameAlreadyBoundException ex) { newCtx.bind("factory", sleeContainer.getServiceManagement().getServiceActivityFactory()); } catch (NameAlreadyBoundException ex) {
.getServiceComponents().values()) { componentRepositoryImpl.putComponent(component); sleeContainer.getServiceManagement().installService( component); componentsInstalled.add(component); .getServiceComponents().values()) { if(componentsInstalled.contains(component)) { sleeContainer.getServiceManagement().uninstallService(component);
/** * @see ResourceManagementMBean#unbindLinkName(String) */ public void unbindLinkName(String linkName) throws NullPointerException, UnrecognizedLinkNameException, DependencyException { if (logger.isDebugEnabled()) { logger.debug("Unbinding RA Entity Link " + linkName); } if (sleeContainer.getServiceManagement().isRAEntityLinkNameReferenced(linkName)) { throw new DependencyException(linkName + " link name is still used by sbbs"); } else { this.resourceAdaptorEntityLinks.remove(linkName); logger.info("Unbound RA Entity Link " + linkName); } }
public void activityEnded() { if (logger.isDebugEnabled()) { logger.debug("Activity ended with handle " + getActivityContextHandle()); } // remove references to this AC in timer and ac naming facility removeNamingBindings(); removeFromTimers(); // Spec 7.3.4.1 Step 10 final int activityFlags = activityContextHandle.getActivityType() == ActivityType.RA ? getActivityFlags() : -1; TransactionContext txContext = sleeContainer.getTransactionManager() .getTransactionContext(); removeFromCache(txContext); factory.removeActivityContext(this); if (activityContextHandle.getActivityType() == ActivityType.RA) { // external activity, notify RA that the activity has ended ((ResourceAdaptorActivityContextHandle) activityContextHandle) .getResourceAdaptorEntity().activityEnded( activityContextHandle.getActivityHandle(), activityFlags); } else if (activityContextHandle.getActivityType() == ActivityType.SERVICE) { sleeContainer.getServiceManagement().activityEnded( (ServiceActivityHandle) activityContextHandle .getActivityHandle()); } }