Package flex.messaging.endpoints

Examples of flex.messaging.endpoints.Endpoint


        
         // necessary to create for later
         HttpFlexSession fs = HttpFlexSession.getFlexSession(req);
         log.info("flex session is " + fs);
        
         Endpoint endpoint = findEndpoint(req, res);           
         log.info("Endpoint: " + endpoint.describeEndpoint());
        
         endpoint.service(req, res);        
      } catch (UnsupportedOperationException ue) {    
         ue.printStackTrace();
         sendError(res);
      } catch (RuntimeException e) {
         e.printStackTrace();
View Full Code Here


     *   @param endpointName The target endpoint name
     *   @return An objectName for the endpoint MBean.
     */
    public String getObjectNameForEndpoint(String endpointName) throws Exception
    {
        Endpoint endpoint = (Endpoint) mb.getEndpoint(endpointName);
        if (endpoint == null)
            throw new Exception("Endpoint " + endpointName + " not found");
       
        BaseControl bc = endpoint.getControl();
        return bc.getObjectName().toString();
    }
View Full Code Here

            String pathInfo = req.getPathInfo();
            String endpointPath = req.getServletPath();
            if (pathInfo != null)
                endpointPath = endpointPath + pathInfo;

            Endpoint endpoint = null;
            try
            {
                endpoint = broker.getEndpoint(endpointPath, contextPath);
            }
            catch (MessageException me)
            {
                if (Log.isInfo())
                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Received invalid request for endpoint path '{0}'.", new Object[] {endpointPath});
               
                if (!res.isCommitted())
                {
                    try
                    {                   
                        res.sendError(HttpServletResponse.SC_NOT_FOUND);
                    }
                    catch (IOException ignore)
                    {}
                }
               
                return;
            }
           
            try
            {
                if (Log.isInfo())
                {
                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Channel endpoint {0} received request.",
                                                                       new Object[] {endpoint.getId()});
                }
                endpoint.service(req, res);
            }
            catch (UnsupportedOperationException ue)
            {
                if (Log.isInfo())
                {
                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Channel endpoint {0} received request for an unsupported operation.",
                                                                       new Object[] {endpoint.getId()},
                                                                       ue);
                }
               
                if (!res.isCommitted())
                {
View Full Code Here

        }
       
        for (Iterator iter=channelIds.iterator(); iter.hasNext();)
        {
            String channelId = (String)iter.next();               
            Endpoint endpoint = broker.getEndpoint(channelId);                                     
            String endpointUrl = endpoint.getUrl();
            int endpointPort = endpoint.getPort();

            // This is only an error if we are using client side url-based load balancing.  If
            // there is a HW load balancer, then we can assume the server.name served up by the
            // SWF can be used to access the cluster members.  With client side load balancing,
            // the clients need the direct URLs of all of the servers.
View Full Code Here

    {
        FlexClientOutboundQueueProcessor processor = null;
       
        try
        {
            Endpoint endpoint = broker.getEndpoint(endpointId);
            if (endpoint instanceof AbstractEndpoint)
            {
                Class processorClass = ((AbstractEndpoint)endpoint).getFlexClientOutboundQueueProcessorClass();
                if (processorClass != null)
                {
View Full Code Here

            // Skip channel-definitions for remote endpoints
            if (chanSettings.isRemote())
                continue;

            // Create the Endpoint
            Endpoint endpoint = broker.createEndpoint(id, url, endpointClassName);
            endpoint.setSecurityConstraint(chanSettings.getConstraint());
            endpoint.setClientType(chanSettings.getClientType());

            // Assign referenced server
            String referencedServerId = chanSettings.getServerId();
            if ((referencedServerId != null) && (endpoint instanceof Endpoint2))
            {
                Server server = broker.getServer(referencedServerId);
                if (server == null)
                {
                    ConfigurationException ce = new ConfigurationException();
                    ce.setMessage(11128, new Object[] {chanSettings.getId(), referencedServerId});
                    throw ce;
                }
                ((Endpoint2)endpoint).setServer(broker.getServer(referencedServerId));
            }

            // Initialize with endpoint properties
            endpoint.initialize(id, chanSettings.getProperties());

            if (Log.isInfo())
            {
                String endpointURL = endpoint.getUrl();
                String endpointSecurity = EndpointControl.getSecurityConstraintOf(endpoint);
                if (StringUtils.isEmpty(endpointSecurity))
                    endpointSecurity = "None";
                Log.getLogger(ConfigurationManager.LOG_CATEGORY).info
                ("Endpoint " + id + " created with security: " +
View Full Code Here

     */
    public Endpoint createEndpoint(String id, String url, String className)
    {
        Class endpointClass = ClassUtil.createClass(className, getClassLoader());

        Endpoint endpoint = (Endpoint)ClassUtil.createDefaultInstance(endpointClass, Endpoint.class);
        endpoint.setId(id);
        endpoint.setUrl(url);
        endpoint.setManaged(isManaged());
        endpoint.setMessageBroker(this);

        return endpoint;
    }
View Full Code Here

    public Endpoint getEndpoint(String path, String contextPath)
    {
        for (Iterator iter = endpoints.keySet().iterator(); iter.hasNext();)
        {
            Object id = iter.next();
            Endpoint e = (Endpoint)endpoints.get(id);

            if (matchEndpoint(path, contextPath, e))
                return e;
        }
        MessageException lme = new MessageException();
View Full Code Here

     * @param id The id of the endpoint.
     * @return The removed endpoint.
     */
    public Endpoint removeEndpoint(String id)
    {
        Endpoint endpoint = getEndpoint(id);
        if (endpoint != null)
        {
            endpoint.stop();
            endpoints.remove(id);
        }
        return endpoint;
    }
View Full Code Here

        // of the configuration.
        ConfigMap channels = new ConfigMap();
        for (Iterator iter = channelIds.iterator(); iter.hasNext();)
        {
            String id = (String)iter.next();
            Endpoint currentEndpoint = getEndpoint(id);

            ConfigMap channel = currentEndpoint.describeEndpoint();
            if (channel.size() > 0)
                channels.addProperty("channel", channel);
        }
        if (channels.size() > 0)
            servicesConfig.addProperty("channels", channels);
View Full Code Here

TOP

Related Classes of flex.messaging.endpoints.Endpoint

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.