Example usage for org.apache.commons.discovery.tools DiscoverClass newInstance

List of usage examples for org.apache.commons.discovery.tools DiscoverClass newInstance

Introduction

In this page you can find the example usage for org.apache.commons.discovery.tools DiscoverClass newInstance.

Prototype

public Object newInstance(Class spiClass, String defaultImpl) throws DiscoveryException, InstantiationException,
        IllegalAccessException, NoSuchMethodException, InvocationTargetException 

Source Link

Document

Create new instance of class implementing SPI.

Usage

From source file:at.gv.egovernment.moa.spss.api.Configurator.java

public static synchronized Configurator getInstance() {
    if (instance == null) {
        try {//from w ww. jav  a 2  s .  c  om
            DiscoverClass discover = new DiscoverClass();
            instance = (Configurator) discover.newInstance(Configurator.class, DEFAULT_IMPLEMENTATION);
        } catch (Exception e) {
            // this can not happen since we provide a valid default 
            // implementation
        }
    }
    return instance;
}

From source file:at.gv.egovernment.moa.spss.api.SignatureCreationService.java

/**
 * Get an instance of the <code>SignatureCreationService</code>.
 * //  w  w w .  jav  a 2  s .c  o  m
 * @return A concrete instance of the <code>SignatureCreationService</code>.
 */
public static synchronized SignatureCreationService getInstance() {
    if (instance == null) {
        try {
            DiscoverClass discover = new DiscoverClass();
            instance = (SignatureCreationService) discover.newInstance(SignatureCreationService.class,
                    DEFAULT_IMPLEMENTATION);
        } catch (Exception e) {
            // this can not happen since we provide a valid default 
            // implementation
        }
    }
    return instance;
}

From source file:at.gv.egovernment.moa.spss.api.SignatureVerificationService.java

/**
 * Get an instance of the <code>SignatureVerificationService</code>.
 * /*w  w w .  j  a  va  2s.  c  o  m*/
 * @return A concrete instance of the 
 * <code>SignatureVerificationService</code>.
 */
public static synchronized SignatureVerificationService getInstance() {
    if (instance == null) {
        try {
            DiscoverClass discover = new DiscoverClass();
            instance = (SignatureVerificationService) discover.newInstance(SignatureVerificationService.class,
                    DEFAULT_IMPLEMENTATION);
        } catch (Exception e) {
            // this can not happen since we provide a valid default 
            // implementation
        }
    }
    return instance;
}

From source file:at.gv.egovernment.moa.spss.api.SPSSFactory.java

/**
 * Returns the single instance of this class.
 * //  w w  w. ja  v a 2 s. c  o  m
 * @return The single instance of this class.
 */
public static synchronized SPSSFactory getInstance() {
    if (instance == null) {
        try {
            DiscoverClass discover = new DiscoverClass();
            instance = (SPSSFactory) discover.newInstance(SPSSFactory.class, DEFAULT_IMPLEMENTATION);
        } catch (Exception e) {
            // this can not happen since we provide a valid default 
            // implementation
        }
    }
    return instance;
}