Package org.wso2.carbon.utils

Examples of org.wso2.carbon.utils.ServerException


            persistenceManager.updateServiceGroupParameter(serviceGroup, parameter);
        } catch (Exception e) {
            String msg = "Error occured while updating parameters of service group: "
                         + serviceGroupName;
            log.error(msg, e);
            throw new ServerException("updateServiceParameters", e);
        }

    }
View Full Code Here



        } catch (Exception e) {
            String msg = "Cannot remove service policy";
            log.error(msg, e);
            throw new ServerException(msg, e);
        }
    }
View Full Code Here

            return params.toArray(new String[params.size()]);
        } catch (Exception e) {
            String msg = "Error occured while getting parameters of service : " + serviceName;
            log.error(msg, e);
            throw new ServerException(msg, e);
        }
    }
View Full Code Here

        } catch (Exception e) {
            String msg = "Error occured while getting parameters of service group : "
                         + serviceGroupName;
            log.error(msg, e);
            throw new ServerException("getServiceParameters", e);
        }
    }
View Full Code Here

        } catch (Exception e) {
            String msg = "Error occured while gettig parameter " + paramName
                         + " of service group : " + serviceGroupName;
            log.error(msg, e);
            throw new ServerException("getServiceParameter", e);
        }
    }
View Full Code Here

            builder = new StAXOMBuilder(xmlFile);
        } catch (Exception e) {
            String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
                         xmlFile;
            log.error(msg, e);
            throw new ServerException(msg, e);
        }
    }
View Full Code Here

     * @throws org.wso2.carbon.utils.ServerException ServerException
     */
    public void init(String repoLocation, String weblocation) throws
                                                              ServerException {
        if (repoLocation == null) {
            throw new ServerException("Axis2 repository not specified!");
        }
        this.webLocation = weblocation;

        // Check whether this is a URL
        isUrlRepo = CarbonUtils.isURL(repoLocation);

        if (isUrlRepo) { // Is repoLocation a URL Repo?
            try {
                new URL(repoLocation).openConnection().connect();
            } catch (IOException e) {
                throw new ServerException("Cannot connect to URL repository " + repoLocation, e);
            }
            this.repoLocation = repoLocation;
        } else { // Is repoLocation a file repo?
            File repo = new File(repoLocation);
            if (repo.exists()) {
                this.repoLocation = repo.getAbsolutePath();
            } else {
                this.repoLocation =
                        System.getProperty("wso2wsas.home") + File.separator +
                                repoLocation;
                repo = new File(this.repoLocation);
                if (!repo.exists()) {
                    this.repoLocation = null;
                    throw new ServerException("Repository location '" + repoLocation +
                            "' not found!");
                }
            }
        }

        axis2xml = CarbonUtils.getAxis2Xml();

        isUrlAxis2Xml = CarbonUtils.isURL(axis2xml);

        if (!isUrlAxis2Xml) { // Is axis2xml a URL to the axis2.xml file?
            File configFile = new File(axis2xml);
            if (!configFile.exists()) {
                //This will fallback to default axis2.xml
                this.axis2xml = null;
                //Thus default
            }
        } else {
            try {
                URLConnection urlConnection = new URL(axis2xml).openConnection();
                urlConnection.connect();
            } catch (IOException e) {
                throw new ServerException("Cannot connect to axis2.xml URL " + repoLocation, e);
            }
            isInitialized = true;
        }
    }
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.utils.ServerException

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.