mil.dod.th.ose.core/src/mil/dod/th/ose/core/factory/api/FactoryRegistry.java
public T createNewObject(final FactoryInternal factory, final String name, final Map<String, Object> properties) 
            throws IllegalArgumentException, FactoryException, FactoryObjectInformationException
    {
        Preconditions.checkNotNull(properties);
        
        final UUID uuid = createAndPersistObject(factory, name);
        
        try
        {
            // create a configuration if needed
            if (!properties.isEmpty()) // only create if there are non-standard properties
            {
                final String factoryPid = factory.getPid();
                final Configuration config = createConfiguration(uuid, factoryPid, null);
                try
                {
                    config.update(new Hashtable<>(properties));
                }
                catch (final IOException e)
                {
                    throw new FactoryException(
                            String.format("Error updating configuration for object with UUID: %s ", uuid), e);
                }
            }
            
            try
            {
                //create instance, will check if object is satisfied
                return createOrRestoreObject(factory, uuid);
            }
            catch (final Exception e)
            {
                tryDeleteConfiguration(uuid);
                throw e;
            }
        }
        catch (final Exception e)
        {
            if (!isPendingObject(uuid))
            {
                m_FactoryObjectDataManager.tryRemove(uuid);
            }

            throw e;
        }
    }
/**
     * Default implementation to create a factory object.
     * 
     * @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 properties
     *      properties for the object
     * @return
     *      the object that was created
     * @throws FactoryException
     *      if there was an error with the creation of the object or its configuration
     * @throws IllegalArgumentException
     *      if the name is a duplicate of a name already in the data store
     * @throws FactoryObjectInformationException
     *      if a problem occurs saving the object's data
     */
Default implementation to create a factory object.


Default implementation to create a factory object .
public T createNewObject(final FactoryInternal factory, final String name, final Map<String, Object> properties) 
            throws IllegalArgumentException, FactoryException, FactoryObjectInformationException
    {
        Preconditions.checkNotNull(properties);
        final UUID uuid = createAndPersistObject(factory, name);
        try
        {
            if (!properties.isEmpty()) 
            {
                final String factoryPid = factory.getPid();
                final Configuration config = createConfiguration(uuid, factoryPid, null);
                try
                {
                    config.update(new Hashtable<>(properties));
                }
                catch (final IOException e)
                {
                    throw new FactoryException(
                            String.format("Error updating configuration for object with UUID: %s ", uuid), e);
                }
            }
            try
            {
                return createOrRestoreObject(factory, uuid);
            }
            catch (final Exception e)
            {
                tryDeleteConfiguration(uuid);
                throw e;
            }
        }
        catch (final Exception e)
        {
            if (!isPendingObject(uuid))
            {
                m_FactoryObjectDataManager.tryRemove(uuid);
            }
            throw e;
        }
    }
public T createNewObject ( final FactoryInternal factory , final String name , final Map < String , Object > properties ) throws IllegalArgumentException , FactoryException , FactoryObjectInformationException { Preconditions . checkNotNull ( properties ) ; final UUID uuid = createAndPersistObject ( factory , name ) ; try { if ( ! properties . isEmpty ( ) ) { final String factoryPid = factory . getPid ( ) ; final Configuration config = createConfiguration ( uuid , factoryPid , null ) ; try { config . update ( new Hashtable < > ( properties ) ) ; } catch ( final IOException e ) { throw new FactoryException ( String . format ( "Error updating configuration for object with UUID: %s " , uuid ) , e ) ; } } try { return createOrRestoreObject ( factory , uuid ) ; } catch ( final Exception e ) { tryDeleteConfiguration ( uuid ) ; throw e ; } } catch ( final Exception e ) { if ( ! isPendingObject ( uuid ) ) { m_FactoryObjectDataManager . tryRemove ( uuid ) ; } throw e ; } }
Default implementation to create a factory object.
Default implementation to create a factory object .
// create a configuration if needed // only create if there are non-standard properties //create instance, will check if object is satisfied