Examples of MessageBroker


Examples of flex.messaging.MessageBroker

      throw new RuntimeException("Room already exists");
    }
   
    // Create a new Message destination dynamically
    String serviceId = "message-service";
    MessageBroker broker = MessageBroker.getMessageBroker(null);
    MessageService service = (MessageService) broker.getService(serviceId);
    MessageDestination destination = (MessageDestination) service.createDestination(id);

    if (service.isStarted())
    {
      destination.start();
View Full Code Here

Examples of flex.messaging.MessageBroker

     */
    public String testGetValidator()
    {
        String validator = "validator is null!";

        MessageBroker broker = FlexContext.getMessageBroker();
        if (broker.getDeserializationValidator() == null )
        {
            validator = "Null Validator Returned";
        }
        else
        {
            validator = broker.getDeserializationValidator().getClass().getName();
        }

        return validator;
    }
View Full Code Here

Examples of flex.messaging.MessageBroker

     */
    public void testSetValidatorBookRemoved()
    {
        try
        {
            MessageBroker broker = FlexContext.getMessageBroker();
            ClassDeserializationValidator dsvalidator =(ClassDeserializationValidator) broker.getDeserializationValidator();
            dsvalidator.removeAllowClassPattern("blazeds.qa.remotingService.Book");

            //System.out.println("Book Validator had Book removed from allowed");
        }
        catch(Exception e)
View Full Code Here

Examples of flex.messaging.MessageBroker

            dsvalidator.addAllowClassPattern("blazeds.qa.remotingService.Book");
            dsvalidator.removeAllowClassPattern("blazeds.qa.remotingService.Book");
            dsvalidator.addAllowClassPattern("blazeds.qa.remotingService.Book");
            dsvalidator.addDisallowClassPattern("blazeds.qa.remotingService.Book");
            dsvalidator.removeDisallowClassPattern("blazeds.qa.remotingService.Book");
            MessageBroker broker = FlexContext.getMessageBroker();
            broker.setDeserializationValidator(dsvalidator);
            //System.out.println("Validator with Book, flex and java set!");
        }
        catch(Exception e)
        {
            System.out.println("test set validator error: " + e.toString());
View Full Code Here

Examples of flex.messaging.MessageBroker

            dsvalidator.addAllowClassPattern("java.*");
            dsvalidator.addAllowClassPattern("javax.*");
            dsvalidator.addAllowClassPattern("\\[Ljava.*");
            dsvalidator.addAllowClassPattern("\\[B*");
            dsvalidator.addDisallowClassPattern("blazeds.qa.remotingService.Book");
            MessageBroker broker = FlexContext.getMessageBroker();
            broker.setDeserializationValidator(dsvalidator);
            //System.out.println("Validator with only 'flex.*' and java, set!");
        }
        catch(Exception e)
        {
            System.out.println("test set empty validator error: " + e.toString());
View Full Code Here

Examples of flex.messaging.MessageBroker

     */
    public void testSetNullValidator()
    {
        try
        {
            MessageBroker broker = FlexContext.getMessageBroker();
            broker.setDeserializationValidator(null);
            //System.out.println("Validator set to null");
        }
        catch(Exception e)
        {
            System.out.println("test set null validator error (remove validator): " + e.toString());
View Full Code Here

Examples of flex.messaging.MessageBroker

    public void testSetTestValidator()
    {
        try
        {
            TestDeserializationValidator dsvalidator = new TestDeserializationValidator();
            MessageBroker broker = FlexContext.getMessageBroker();
            broker.setDeserializationValidator(dsvalidator);
            //System.out.println("TestValidator with class logging only set!");
        }
        catch(Exception e)
        {
            System.out.println("test set TestValidator error: " + e.toString());
View Full Code Here

Examples of flex.messaging.MessageBroker

        }     
       
        this.id = id;
       
        // Update the service id in the broker
        MessageBroker broker = getMessageBroker();
        if (broker != null)
        {
            // broker must have the service then
            broker.removeService(oldId);
            broker.addService(this);
        }           
    }
View Full Code Here

Examples of flex.messaging.MessageBroker

     *
     * @param broker <code>MessageBroker</code> of the <code>AbstractBootstrapService</code>.
     */
    public void setMessageBroker(MessageBroker broker)
    {
        MessageBroker oldBroker = getMessageBroker();                                   

        this.broker = broker;

        if (oldBroker != null)
        {
            oldBroker.removeService(getId());
        }      
               
        // Add service to the new broker if needed
        if (broker.getService(getId()) != this)
            broker.addService(this);       
View Full Code Here

Examples of flex.messaging.MessageBroker

                        }
                    }
                    instance.applicationInstance = inst;

                    // increment attribute-id reference count on MB
                    MessageBroker mb = FlexContext.getMessageBroker();
                    if (mb != null)
                    {
                        mb.incrementAttributeIdRefCount(instance.getAttributeId());
                    }
                }
            }
            catch (Throwable t)
            {
                ConfigurationException ex = new ConfigurationException();
                ex.setMessage(SINGLETON_ERROR, new Object[] { instance.getSource(), id });
                ex.setRootCause(t);

                if (Log.isError())
                    Log.getLogger(ConfigurationManager.LOG_CATEGORY).error(ex.getMessage() + StringUtils.NEWLINE + ExceptionUtil.toString(t));

                throw ex;
            }
        }
        else if(instance.getScope().equalsIgnoreCase(SCOPE_SESSION))
        {
            // increment attribute-id reference count on MB for Session scoped instances
            MessageBroker mb = FlexContext.getMessageBroker();
            if (mb != null)
            {
                mb.incrementAttributeIdRefCount(instance.getAttributeId());
            }
        }
        return instance;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.