Package npanday.registry

Examples of npanday.registry.Repository


            throw new IOException( "NPANDAY-084-002: Repository class name must be provided: File Name = " + fileUri +
                ", Properties = " + props.toString() );
        }

        InputStream stream;
        Repository repository;
        try
        {
            stream = new FileInputStream( fileUri );
        }
        catch ( IOException e )
        {
            stream = this.getClass().getResourceAsStream( fileUri );
        }
        String message =
            "File Name = " + fileUri + ", Repository Class = " + repositoryClass + ", Properties = " + props.toString();
        boolean optional = ( initParams.containsKey( "optional" ) &&
            ( (String) initParams.get( "optional" ) ).equalsIgnoreCase( "true" ) );
        if ( stream == null && !optional )
        {
            throw new IOException( "NPANDAY-084-003: Unable to loadRegistry config file: " + message );
        }
        else if ( stream == null && optional )
        {
            return null;
        }

        try
        {
            Class c = Class.forName( repositoryClass );
            repository = (Repository) c.newInstance();
            repository.setRepositoryRegistry( repositoryRegistry );
            repository.load( stream, props );
            repository.setSourceUri( fileUri );
        }
        catch ( NPandayRepositoryException e )
        {
            throw new NPandayRepositoryException( "NPANDAY-084-004: " + e.toString() + " : " + message, e );
        }
View Full Code Here



    public Repository find( String repositoryName )
        throws RepositoryNotFoundException
    {
        Repository repository = repositoryRegistry.find( repositoryName );
        if ( repository == null )
        {
            throw new RepositoryNotFoundException(
                "NPANDAY-061-002: Could not find repository: Name = " + repositoryName );
        }
View Full Code Here

            RepositoryObject repositoryObject = (RepositoryObject) i.next();
            String repositoryName = repositoryObject.getRepositoryName();
            String className = repositoryObject.getRepositoryClass();
            String fileName = repositoryObject.getRepositoryConfig();
            //instantiate class based on info in the registry-config file
            Repository repository =
                repositoryLoader.loadRepository( toPath( fileName ), className, repositoryObject.getInitParams() );

            if ( repository != null )
            {
                repoMap.put( repositoryName, repository );
View Full Code Here

    }

    public Repository find( String repositoryName )
        throws RepositoryNotFoundException
    {
        Repository repository = repositoryRegistry.find( repositoryName );
        if ( repository == null )
        {
            throw new RepositoryNotFoundException(
                "NPANDAY-064-000: Could not find repository: Name = " + repositoryName );
        }
View Full Code Here

    }

    public Repository find( String repositoryName )
        throws RepositoryNotFoundException
    {
        Repository repository = repositoryRegistry.find( repositoryName );
        if ( repository == null )
        {
            throw new RepositoryNotFoundException(
                "NPANDAY-064-000: Could not find repository: Name = " + repositoryName );
        }
View Full Code Here

TOP

Related Classes of npanday.registry.Repository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.