Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.SourceFactory


        final ServiceManager m = this.getComponentLocator();

        Source source = null;
        // search for a SourceFactory implementing the protocol
        SourceFactory factory = null;
        try {
            factory = this.getSourceFactory(m, protocol);
            systemID = this.absolutize(factory, baseURI, systemID);
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Resolved to systemID : " + systemID);
            }
            source = factory.getSource(systemID, parameters);
        } catch (final ProcessingException ce) {
            // no selector available, use fallback
        } finally {
            m.release(factory);
        }

        if (null == source) {
            try {
                factory = this.getSourceFactory(m, "*");
                systemID = this.absolutize(factory, baseURI, systemID);
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Resolved to systemID : " + systemID);
                }
                source = factory.getSource(systemID, parameters);
            } catch (ProcessingException se) {
                throw new SourceException("Unable to select source factory for " + systemID, se);
            } finally {
                m.release(factory);
            }
View Full Code Here


        } else {
            final ServiceManager m = this.getComponentLocator();

            // search for a SourceFactory implementing the protocol
            final String scheme = source.getScheme();
            SourceFactory factory = null;

            try {
                factory = this.getSourceFactory(m, scheme);
                factory.release(source);
            } catch (ProcessingException se) {
                try {
                    factory = this.getSourceFactory(m, "*");
                    factory.release(source);
                } catch (ProcessingException sse) {
                    throw new SourceFactoryNotFoundException("Unable to select source factory for " + source.getURI(), se);
                }
            } finally {
                m.release(factory);
View Full Code Here

                protocol = "*";
        }

        Source source = null;
        // search for a SourceFactory implementing the protocol
        SourceFactory factory = null;
        try
        {
            factory = this.getSourceFactory( protocol );
            if ( factory != null )
            {
                systemID = absolutize( factory, baseURI, systemID );
                if( this.isDebugEnabled() )
                    this.debug( "Resolved to systemID : " + systemID );
                source = factory.getSource( systemID, parameters );
            }
        }
        finally
        {
            this.releaseSourceFactory( factory );
        }

        if( null == source )
        {
            try
            {
                factory = this.getSourceFactory("*");
                if ( factory == null )
                {
                    throw new SourceException( "Unable to select source factory for '" + systemID + "'. No default factory found.");
                }
                systemID = absolutize( factory, baseURI, systemID );
                if( this.isDebugEnabled() )
                    this.debug( "Resolved to systemID : " + systemID );
                source = factory.getSource( systemID, parameters );
            }
            finally
            {
                this.releaseSourceFactory(factory);
            }
View Full Code Here

    {
        if( source == null ) return;

        // search for a SourceFactory implementing the protocol
        final String scheme = source.getScheme();
        SourceFactory factory = null;

        try
        {
            factory = this.getSourceFactory(scheme);
            if ( factory == null )
            {
                factory = this.getSourceFactory("*");
                if ( factory == null )
                {
                    throw new RuntimeException( "Unable to select source factory for '" + source.getURI() + "'.");
                }
            }
            factory.release(source);
        }
        finally
        {
            this.releaseSourceFactory( factory );
        }
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.SourceFactory

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.