mil.dod.th.ose.core/src/mil/dod/th/ose/core/factory/api/FactoryRegistry.java
public T createNewObjectForConfig(final FactoryInternal factory, final String name, final String configPid) 
            throws IllegalArgumentException, FactoryException, FactoryObjectInformationException, IOException, 
                InvalidSyntaxException
    {
        Preconditions.checkNotNull(configPid);
     
        final Configuration config = FactoryServiceUtils.getFactoryConfiguration(m_ConfigAdmin, configPid);
        if (config == null)
        {
            throw new IllegalArgumentException(String.format("No configuration exists with PID: %s ", configPid));
        }
        
        if (getObjectByPid(configPid) != null)
        {
            throw new IllegalArgumentException(
                    String.format("A factory object is already associated to configuration with PID: %s", configPid));
        }
        
        final UUID uuid = createAndPersistObject(factory, name);
        
        try
        {
            m_FactoryObjectDataManager.setPid(uuid, configPid);

            //create instance, will check if object is satisfied
            return createOrRestoreObject(factory, uuid);
        }
        catch (final Exception e)
        {
            m_FactoryObjectDataManager.tryRemove(uuid);
            throw e;
        }
    }
/**
     * Implementation that creates a factory object that is associated with a specific configuration.
     * 
     * @param factory
     *      factory used to create the object
     * @param name
     *      the name to assign to the newly created object or null to use a default
     * @param configPid
     *      PID of the configuration the factory object should be associated with
     * @return
     *      the object that was created
     * @throws IllegalArgumentException
     *      thrown if no configuration with the specified PID can be found, the configuration specified is already 
     *      associated with a factory object, or the name is a duplicate of a name already in the data store
     * @throws FactoryException
     *      thrown if there was an error with the creation of the object
     * @throws FactoryObjectInformationException
     *      thrown if a problem occurs saving the object's data
     * @throws IOException
     *      thrown if an error occurs attempting to verify the existence of the configuration with the specified PID
     * @throws InvalidSyntaxException
     *      thrown if an error occurs attempting to verify the existence of the configuration with the specified PID
     */
Implementation that creates a factory object that is associated with a specific configuration.


Implementation that creates a factory object that is associated with a specific configuration .
public T createNewObjectForConfig(final FactoryInternal factory, final String name, final String configPid) 
            throws IllegalArgumentException, FactoryException, FactoryObjectInformationException, IOException, 
                InvalidSyntaxException
    {
        Preconditions.checkNotNull(configPid);
        final Configuration config = FactoryServiceUtils.getFactoryConfiguration(m_ConfigAdmin, configPid);
        if (config == null)
        {
            throw new IllegalArgumentException(String.format("No configuration exists with PID: %s ", configPid));
        }
        if (getObjectByPid(configPid) != null)
        {
            throw new IllegalArgumentException(
                    String.format("A factory object is already associated to configuration with PID: %s", configPid));
        }
        final UUID uuid = createAndPersistObject(factory, name);
        try
        {
            m_FactoryObjectDataManager.setPid(uuid, configPid);
            return createOrRestoreObject(factory, uuid);
        }
        catch (final Exception e)
        {
            m_FactoryObjectDataManager.tryRemove(uuid);
            throw e;
        }
    }
public T createNewObjectForConfig ( final FactoryInternal factory , final String name , final String configPid ) throws IllegalArgumentException , FactoryException , FactoryObjectInformationException , IOException , InvalidSyntaxException { Preconditions . checkNotNull ( configPid ) ; final Configuration config = FactoryServiceUtils . getFactoryConfiguration ( m_ConfigAdmin , configPid ) ; if ( config == null ) { throw new IllegalArgumentException ( String . format ( "No configuration exists with PID: %s " , configPid ) ) ; } if ( getObjectByPid ( configPid ) != null ) { throw new IllegalArgumentException ( String . format ( "A factory object is already associated to configuration with PID: %s" , configPid ) ) ; } final UUID uuid = createAndPersistObject ( factory , name ) ; try { m_FactoryObjectDataManager . setPid ( uuid , configPid ) ; return createOrRestoreObject ( factory , uuid ) ; } catch ( final Exception e ) { m_FactoryObjectDataManager . tryRemove ( uuid ) ; throw e ; } }
Implementation that creates a factory object that is associated with a specific configuration.
Implementation that creates a factory object that is associated with a specific configuration .
//create instance, will check if object is satisfied