src/main/java/js/container/ServiceInstanceFactory.java
@SuppressWarnings("unchecked")
	@Override
	public <I> I newInstance(ManagedClassSPI managedClass, Object... args) {
		if (args.length > 0) {
			throw new IllegalArgumentException("Service instances factory does not support arguments.");
		}
		Class<?>[] interfaceClasses = managedClass.getInterfaceClasses();
		if (interfaceClasses == null) {
			throw new BugError("Invalid managed class. Null interface classes.");
		}
		if (interfaceClasses.length != 1) {
			throw new BugError("Invalid managed class. It should have exactly one interface class.");
		}
		return (I) Classes.loadService(interfaceClasses[0]);
	}
@SuppressWarnings("unchecked")
	@Override
	public <I> I newInstance(ManagedClassSPI managedClass, Object... args) {
		if (args.length > 0) {
			throw new IllegalArgumentException("Service instances factory does not support arguments.");
		}
		Class<?>[] interfaceClasses = managedClass.getInterfaceClasses();
		if (interfaceClasses == null) {
			throw new BugError("Invalid managed class. Null interface classes.");
		}
		if (interfaceClasses.length != 1) {
			throw new BugError("Invalid managed class. It should have exactly one interface class.");
		}
		return (I) Classes.loadService(interfaceClasses[0]);
	}
@ SuppressWarnings ( "unchecked" ) @ Override public < I > I newInstance ( ManagedClassSPI managedClass , Object ... args ) { if ( args . length > 0 ) { throw new IllegalArgumentException ( "Service instances factory does not support arguments." ) ; } Class < ? > [ ] interfaceClasses = managedClass . getInterfaceClasses ( ) ; if ( interfaceClasses == null ) { throw new BugError ( "Invalid managed class. Null interface classes." ) ; } if ( interfaceClasses . length != 1 ) { throw new BugError ( "Invalid managed class. It should have exactly one interface class." ) ; } return ( I ) Classes . loadService ( interfaceClasses [ 0 ] ) ; }
Load service defined by managed class interface and return service instance. This factory does not support arguments.
Service provider should be present into run-time otherwise no provider exception is thrown.

@param managedClass managed class,
@param args service instances factory does not support arguments.
@return loaded service instance.
@throws IllegalArgumentException if <code>args</code> argument is not empty.
@throws NoProviderException if no service provider found on run-time for requested interface.
Load service defined by managed class interface and return service instance . This factory does not support arguments . Service provider should be present into run - time otherwise no provider exception is thrown .