Package javax.xml.registry

Examples of javax.xml.registry.ConnectionFactory


    public void testJaxrJNDIConnection() throws Exception
    {
        String bindname = System.getProperty("jndi.bind.name");
        InitialContext ctx = getClientContext();
        ConnectionFactory factory = (ConnectionFactory) ctx.lookup(bindname);
        assertNotNull("Connection Factory from JNDI:", factory);
    }
View Full Code Here


        if (config.getConnectionFactoryBinding() != null) {
            try {
                String jndiName = config.getConnectionFactoryBinding();
                ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
                BinderService binderService = new BinderService(bindInfo.getBindName());
                ConnectionFactory jaxrFactory = loadConnectionFactoryImplementation(config);
                //set jaxr properties from the config if there are any
                setJAXRFactoryProperies(jaxrFactory, config.getProperties());
                ImmediateValue<ConnectionFactory> value = new ImmediateValue<ConnectionFactory>(jaxrFactory);
                binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(value));
                binderService.getNamingStoreInjector().inject((ServiceBasedNamingStore) injectedJavaContext.getValue());
View Full Code Here

     * @return
     * @throws JAXRException
     */
    protected ConnectionFactory loadConnectionFactoryImplementation(final JAXRConfiguration config) throws JAXRException {

        ConnectionFactory jaxrFactory = null;
        //1. try to read from a system property
        String factoryName = SecurityActions.getSystemProperty(JAXRConstants.JAXR_FACTORY_IMPLEMENTATION, null);
        if (factoryName!=null) JAXR_LOGGER.factoryNameFromSystemProperty(JAXRConstants.JAXR_FACTORY_IMPLEMENTATION, factoryName);
        //2. try to obtain from jboss config
        else factoryName = config.getConnectionFactoryImplementation();
View Full Code Here

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        String method = req.getParameter("method");
        PrintWriter writer = res.getWriter();
        try {
            ConnectionFactory factory;
            if ("lookup".equals(method)) {
                String lookup = "java:jboss/jaxr/ConnectionFactory";
                InitialContext context = new InitialContext();
                factory = (ConnectionFactory) context.lookup(lookup);
            }
            else if ("new".equals(method)) {
                factory = ConnectionFactory.newInstance();
            } else {
                throw new IllegalArgumentException("Invalid method: " + method);
            }
            log.infof("ConnectionFactory at '%s' => %s", method, factory);
            writer.println(factory.getClass().getName());
        } catch (Exception ex) {
            ex.printStackTrace(writer);
        } finally {
            writer.close();
        }
View Full Code Here

    protected Connection getConnection()
    {
        Connection connection = null;
        try
        {   // Create the connection, passing it the configuration properties
            ConnectionFactory factory = ConnectionFactory.newInstance();
            factory.setProperties(props);
            connection = factory.createConnection();
            connection.setCredentials(creds);
        } catch (JAXRException e) {
            logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
        }
        return connection;
View Full Code Here

    public void testJaxrJNDIConnection() throws Exception
    {
        String bindname = System.getProperty("jndi.bind.name");
        InitialContext ctx = getClientContext();
        ConnectionFactory factory = (ConnectionFactory) ctx.lookup(bindname);
        assertNotNull("Connection Factory from JNDI:", factory);
    }
View Full Code Here

        for(int i=0; i<registryLocations.length;i++){
            try{
                boolean unpublished = false;
                mockRegistry = Boolean.getBoolean(MOCK_REGISTRY);
                if (!mockRegistry){// true only for MockRegistry
                    ConnectionFactory cf = lookupConnection(registryLocations[i]);
                    unpublished = unpublishFromRegistry(cf, webServiceName,
                            registryLocations[i]);
                }else {
                    unpublished = true;
                }
View Full Code Here

     */
    private ConnectionFactory lookupConnection(String registryLocation)
    throws NamingException {
       
        InitialContext ic = new InitialContext();
        ConnectionFactory cf = (javax.xml.registry.ConnectionFactory)
        ic.lookup(registryLocation);
        _logger.fine("RegistryAccessObject.lookupConnection : " +
                "for registryLocation " +registryLocation);
        return cf;
    }
View Full Code Here

        prop.setProperty("javax.xml.registry.factoryClass",
                "org.apache.juddi.jaxr.registry.ConnectionFactoryImpl");
    }

    private static Connection getConnection() throws JAXRException {
        ConnectionFactory factory = ConnectionFactoryImpl.newInstance();
        factory.setProperties(prop);
        Connection conn = factory.createConnection();
        if (conn == null) System.out.println("No Connection");
        return conn;
    }
View Full Code Here

        prop.setProperty("javax.xml.registry.factoryClass",
                "org.apache.juddi.jaxr.registry.ConnectionFactoryImpl");
    }

    private static Connection getConnection() throws JAXRException {
        ConnectionFactory factory = ConnectionFactoryImpl.newInstance();
        factory.setProperties(prop);
        Connection conn = factory.createConnection();
        if (conn == null) System.out.println("No Connection");
        return conn;
    }
View Full Code Here

TOP

Related Classes of javax.xml.registry.ConnectionFactory

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.