container/services/src/main/java/org/mobicents/slee/container/management/ServiceManagementImpl.java
public ServiceID[] getServices(ServiceState serviceState)
			throws NullPointerException, ManagementException {

		if (serviceState == null)
			throw new NullPointerException("Passed a null state");

		try {
			ArrayList<ServiceID> retval = new ArrayList<ServiceID>();
			for (ServiceID serviceID : componentRepositoryImpl.getServiceIDs()) {
				ServiceComponent service = componentRepositoryImpl
						.getComponentByID(serviceID);
				if (service == null) {
					throw new UnrecognizedServiceException(serviceID.toString());
				}
				if (service.getServiceState().equals(serviceState)) {
					retval.add(serviceID);
				}
			}
			return retval.toArray(new ServiceID[retval.size()]);
		} catch (Exception e) {
			throw new ManagementException("Error getting services by state!", e);
		}
	}
public ServiceID[] getServices(ServiceState serviceState)
			throws NullPointerException, ManagementException {

		if (serviceState == null)
			throw new NullPointerException("Passed a null state");

		try {
			ArrayList<ServiceID> retval = new ArrayList<ServiceID>();
			for (ServiceID serviceID : componentRepositoryImpl.getServiceIDs()) {
				ServiceComponent service = componentRepositoryImpl
						.getComponentByID(serviceID);
				if (service == null) {
					throw new UnrecognizedServiceException(serviceID.toString());
				}
				if (service.getServiceState().equals(serviceState)) {
					retval.add(serviceID);
				}
			}
			return retval.toArray(new ServiceID[retval.size()]);
		} catch (Exception e) {
			throw new ManagementException("Error getting services by state!", e);
		}
	}
public ServiceID [ ] getServices ( ServiceState serviceState ) throws NullPointerException , ManagementException { if ( serviceState == null ) throw new NullPointerException ( "Passed a null state" ) ; try { ArrayList < ServiceID > retval = new ArrayList < ServiceID > ( ) ; for ( ServiceID serviceID : componentRepositoryImpl . getServiceIDs ( ) ) { ServiceComponent service = componentRepositoryImpl . getComponentByID ( serviceID ) ; if ( service == null ) { throw new UnrecognizedServiceException ( serviceID . toString ( ) ) ; } if ( service . getServiceState ( ) . equals ( serviceState ) ) { retval . add ( serviceID ) ; } } return retval . toArray ( new ServiceID [ retval . size ( ) ] ) ; } catch ( Exception e ) { throw new ManagementException ( "Error getting services by state!" , e ) ; } }
/*
(non-Javadoc)

@see javax.slee.management.ServiceManagementMBean#getServices(javax.slee.
management.ServiceState)
/ * ( non - Javadoc )