Package com.sun.appserv.connectors.internal.api

Examples of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException


     */
    public void recreateConnectorConnectionPool(ConnectorConnectionPool ccp)
            throws ConnectorRuntimeException {
        ConnectorRegistry registry = ConnectorRegistry.getInstance();
        if (registry == null) {
            throw new ConnectorRuntimeException(
                    "Cannot get ConnectorRegistry");
        }
        PoolInfo poolInfo = ccp.getPoolInfo();
        //First remove this pool from memory
        try {
            unloadAndKillPool(poolInfo);
        } catch (ConnectorRuntimeException cre) {
            throw cre;
        }
        //kill the pool
        //FIXME: deleteConnectorConnectionPool should do this
        //PoolManager poolManager = Switch.getSwitch().getPoolManager();
        //poolManager.killPool( poolName );

        //Now bind the updated pool and
        //obtain a new managed connection factory for this pool

        String jndiNameForPool = ConnectorAdminServiceUtils.
                getReservePrefixedJNDINameForPool(poolInfo);
        ManagedConnectionFactory mcf = null;
        try {
            _runtime.getResourceNamingService().publishObject(poolInfo, jndiNameForPool, ccp, true);
            mcf = obtainManagedConnectionFactory(poolInfo);

        } catch (NamingException ne) {
            _logger.log(Level.SEVERE,
                    "rardeployment.pool_jndi_bind_failure", poolInfo);
            String i18nMsg = localStrings.getString(
                    "ccp_adm.could_not_recreate_pool", poolInfo);
            ConnectorRuntimeException crex = new ConnectorRuntimeException(i18nMsg);
            crex.initCause(ne);
            throw crex;
        } finally{
            if (mcf == null) {
                try{
                    _runtime.getResourceNamingService().unpublishObject(poolInfo, jndiNameForPool);
                }catch(NamingException e){
                    _logger.log(Level.WARNING,"Unable to unbind the pool configuration object " +
                            "of pool [ "+ poolInfo +" ] during MCF creation failure");
                }
                _logger.log(Level.WARNING, "rardeployment.mcf_creation_failure", poolInfo);

                String i18nMsg = localStrings.getString(
                        "ccp_adm.failed_to_create_mcf", poolInfo);
                throw new ConnectorRuntimeException(i18nMsg);
            }
        }

    }
View Full Code Here


        if (result == false) {
            _logger.log(Level.SEVERE,
                    "rardeployment.mcf_removal_failure", poolInfo);
            String i18nMsg = localStrings.getString(
                    "ccp_adm.wrong_params_for_create", poolInfo);
            ConnectorRuntimeException cre = new
                    ConnectorRuntimeException(i18nMsg);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "", cre);
            }
            throw cre;
        }
        try {
            String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
            _runtime.getResourceNamingService().unpublishObject(poolInfo, jndiNameForPool);
        } catch (NamingException ne) {
            String i18nMsg = localStrings.getString(
                    "ccp_adm.failed_to_remove_from_jndi", poolInfo);
            ConnectorRuntimeException cre = new
                    ConnectorRuntimeException(i18nMsg);
            cre.initCause(ne);
            _logger.log(Level.SEVERE,
                    "rardeployment.connectionpool_removal_from_jndi_error",
                    poolInfo);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "", cre);
View Full Code Here

            if(_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "Wrong parameters for pool creation ");
            }
            String i18nMsg = localStrings.getString(
                    "ccp_adm.wrong_params_for_create");
            throw new ConnectorRuntimeException(i18nMsg);
        }

/*
        ConnectorDescriptor connectorDescriptor =
                _registry.getDescriptor(rarName);
View Full Code Here

    public boolean flushConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException {
        PoolManager poolMgr = _runtime.getPoolManager();
        try {
            return poolMgr.flushConnectionPool( poolInfo );
        } catch (PoolingException ex) {
            ConnectorRuntimeException e = new ConnectorRuntimeException(
                    ex.getLocalizedMessage() +
                    ". Please check the server.log for more details.");
            e.initCause(ex);
            throw e;

        }
    }
View Full Code Here

    public String getActivationSpecClass( ConnectorDescriptor desc,
             String messageListenerType) throws ConnectorRuntimeException
    {
        if(desc == null) {
            throw new ConnectorRuntimeException("Invalid arguments");
        }

        MessageListener messageListeners[] =
               ddTransformUtil.getMessageListeners(desc);
View Full Code Here

    public String[] getMessageListenerTypes(ConnectorDescriptor desc)
               throws ConnectorRuntimeException
    {

        if(desc == null) {
            throw new ConnectorRuntimeException("Invalid arguments");
        }

        MessageListener messageListeners[] =
               ddTransformUtil.getMessageListeners(desc);
View Full Code Here

    }

    private MessageListener getMessageListener(ConnectorDescriptor desc, String messageListenerType)
            throws ConnectorRuntimeException {
        if(desc == null || messageListenerType == null) {
            throw new ConnectorRuntimeException("Invalid arguments");
        }

        MessageListener allMessageListeners[] =
               ddTransformUtil.getMessageListeners(desc);

        MessageListener messageListener = null;
        for(int i=0;i<allMessageListeners.length;++i) {
            if(messageListenerType.equals(
                    allMessageListeners[i].getMessageListenerType())) {
                messageListener = allMessageListeners[i];
            }
        }

        if(messageListener == null) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE,
                        "No such MessageListener found in ra.xml",
                        messageListenerType);
            }
            throw new ConnectorRuntimeException(
                  "No such MessageListener found in ra.xml : " +
                  messageListenerType);
        }
        return messageListener;
    }
View Full Code Here

    }

    public List<String> getConfidentialProperties(ConnectorDescriptor desc, String rarName, String... keyFields)
            throws ConnectorRuntimeException {
        if(keyFields == null || keyFields.length == 0 || keyFields[0] == null){
            throw new ConnectorRuntimeException("MessageListenerType must be specified");
        }
        MessageListener messageListener = getMessageListener(desc, keyFields[0]);
        List<String> confidentialProperties = new ArrayList<String>();
        Set configProperties = messageListener.getConfigProperties();
        if(configProperties != null){
View Full Code Here

                startResourceAdapter(bootStrapContextImpl);

            } catch (ResourceAdapterInternalException ex) {
                _logger.log(Level.SEVERE, "rardeployment.start_failed", ex);
                String i18nMsg = localStrings.getString("rardeployment.start_failed", ex.getMessage());
                ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
                cre.initCause(ex);
                throw cre;
            } catch (Throwable t) {
                _logger.log(Level.SEVERE, "rardeployment.start_failed", t);
                String i18nMsg = localStrings.getString("rardeployment.start_failed", t.getMessage());
                ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg);
                if (t.getCause() != null) {
                    cre.initCause(t.getCause());
                } else {
                    cre.initCause(t);
                }
                throw cre;
            }
        }
    }
View Full Code Here

            boolean supported = workContextHandler.isContextSupported(true, ic );
            if(!supported){
                String errorMsg = "Unsupported work context [ "+ ic + " ] ";
                Object params[] = new Object[]{ic, desc.getName()};
                _logger.log(Level.WARNING,"unsupported.work.context", params);
                throw new ConnectorRuntimeException(errorMsg);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.connectors.internal.api.ConnectorRuntimeException

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.