Examples of QMan


Examples of org.apache.qpid.management.domain.services.QMan

   * @throws ServletException when It's not possibile to proceed with initialization.
   */
  @Override
  public void init() throws ServletException
  {
    qman = new QMan();
    try {
      qman.start();
    } catch (StartupFailureException exception)
    {
      throw new ServletException(exception);
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

  @Override
  protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
  {
    try
   
      QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
      List<ManagementClient> managementClient = qman.getManagementClients();
     
      if (!managementClient.isEmpty())
      {
        BrokerModel model = new BrokerModel();
        model.setId(managementClient.toString());
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

  public void init()
  {
        Configuration configuration = Configuration.getInstance();
        if (configuration.hasOneOrMoreBrokersDefined())
        {
          QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
         
          LOGGER.info(Messages.QMAN_000003_CREATING_MANAGEMENT_CLIENTS);
            for (Entry<UUID, BrokerConnectionData> entry : Configuration.getInstance().getConnectionInfos())
            {
              qman.createManagementClient(entry.getKey(), entry.getValue());
            }
    } else
    {
      LOGGER.info(Messages.QMAN_000022_NO_BROKER_CONFIGURED);
    }
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

   */
  public void contextInitialized(ServletContextEvent event)
  {
    try
    {
      QMan qman = new QMan();
      qman.start();
      event.getServletContext().setAttribute(
          Names.APPLICATION_NAME,
          qman);
    } catch (StartupFailureException exception)
    {
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

   */
  public void contextDestroyed(ServletContextEvent event)
  {
    ServletContext context = event.getServletContext();
   
    QMan qman = (QMan) context.getAttribute(Names.APPLICATION_NAME);   
    qman.stop();
   
    context.removeAttribute(Names.APPLICATION_NAME);
 
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
  {
    try
   
      QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
      List<ManagementClient> managementClients = qman.getManagementClients();
     
      List<BrokerConnectionData> brokers = new ArrayList<BrokerConnectionData>(managementClients.size());
     
      if (!managementClients.isEmpty())
      {
View Full Code Here

Examples of org.apache.qpid.management.domain.services.QMan

  @Override
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
  {
    try
   
      QMan qman = (QMan)getServletContext().getAttribute(Names.APPLICATION_NAME);
     
      String host = request.getParameter("host");
      String portString = request.getParameter("port");
      String virtualHost = request.getParameter("virtualHost");
      String username = request.getParameter("username");
      String password = request.getParameter("password");
     
      String initialCapacityString = request.getParameter("initialCapacity");
      String maxCapacityString = request.getParameter("maxCapacity");
      String maxWaitTimeoutString = request.getParameter("maxWaitTimeout");
     
      List<String> errors = new LinkedList<String>();
      int port = 0;
      int initialPoolCapacity = 0;
      int maxPoolCapacity = 0;
      long maxWaitTimeout = 0;
     
      if(host== null || host.trim().length()==0)
      {
        errors.add("Invalid value for \"host\" attribute. Must be not null.");       
      }

      if(virtualHost == null || virtualHost.trim().length()==0)
      {
        errors.add("Invalid value for \"virtualHost\" attribute. Must be not null.");       
      }
     
      try
      {
        port = Integer.parseInt(portString);
      } catch(Exception exception)
      {
        errors.add("Invalid value for \"port\" attribute. Must be not null and must be a number.");
      }
     
      try
      {
        initialPoolCapacity = Integer.parseInt(initialCapacityString);
      } catch(Exception exception)
      {
        errors.add("Invalid value for \"Initial Pool Capacity\" attribute. Must be not null and must be a number.");
      }
     
      try
      {
        maxPoolCapacity = Integer.parseInt(maxCapacityString);
      } catch(Exception exception)
      {
        errors.add("Invalid value for \"Max Pool Capacity\" attribute. Must be not null and must be a number.");
      }

      try
      {
        maxWaitTimeout = Long.parseLong(maxWaitTimeoutString);
      } catch(Exception exception)
      {
        errors.add("Invalid value for \"Max Wait Timeout\" attribute. Must be not null and must be a number.");
      }
     
      request.setAttribute("errors", errors);
     
      if (errors.isEmpty())
      {
        qman.addBroker(
            host,
            port,
            username,
            password,
            virtualHost,
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.