Examples of ApplicationProperties


Examples of fr.soleil.application.ApplicationProperties

     * version.
     *
     * @return an {@link ApplicationProperties}
     */
    protected ApplicationProperties createProjectBundle() {
        ApplicationProperties result = null;
        try {
            result = new ApplicationProperties(getClass().getPackage().getName() + ".application");
        }
        catch (Exception e) {
            result = null;
        }
        return result;
View Full Code Here

Examples of gov.nist.scap.xccdf.util.ApplicationProperties

        + "s%3$s", rule.getId(), "", result.toUpperCase());
    System.out.println(output);
  }

  private static void logBuildProperties() {
        ApplicationProperties applicationProperties = new ApplicationProperties(XCCDFInterpreter.class);
        log.info(new StringBuilder()
      .append(applicationProperties.getApplicationName())
      .append(" v")
      .append(applicationProperties.getBuildVersion())
      .append(" build ")
      .append(applicationProperties.getBuildNumber())
      .toString());
        outputOsProperties();
  }
View Full Code Here

Examples of halfpipe.core.ApplicationProperties

        return new ServerProperties();
    }

    @Bean
    public ApplicationProperties halfpipeProperties(ApplicationContext context) {
        ApplicationProperties appProps = new ApplicationProperties();
        appProps.setId("testId");
        return appProps;
    }
View Full Code Here

Examples of halfpipe.core.ApplicationProperties

        ApplicationContext context = event.getApplicationContext();
        ConsulProperties consulProperties = context.getBean(ConsulProperties.class);
        if (!consulProperties.isEnabled())
            return;

        ApplicationProperties appProps = context.getBean(ApplicationProperties.class);
        ServerProperties serverProperties = context.getBean(ServerProperties.class);
        AgentClient agentClient = context.getBean(AgentClient.class);

        Service service = new Service();
        service.setName(appProps.getId());
        Integer port = serverProperties.getPort();
        if (port == null) {
            port = 8080;
        }
        service.setPort(port);
        service.setTags(consulProperties.getTags());

        //TODO: add support for Check

        register(agentClient, service);

        String managementPort = context.getEnvironment().getProperty("management.port", (String) null);
        if (managementPort != null) {
            Service management = new Service();
            management.setName(appProps.getId() + "/management"); //TODO: configurable management suffix
            management.setPort(Integer.parseInt(managementPort));
            List<String> tags = new ArrayList<>(consulProperties.getTags());
            tags.add("management"); //TODO: configurable management tag
            management.setTags(tags);

            register(agentClient, management);
        }

        if (!appProps.getRoutes().isEmpty()) {
            try {
                KVClient kvClient = context.getBean(KVClient.class);

                String key = String.format("routing/%s", appProps.getId());
                //TODO: get routes from jax-rs and spring mvc
                kvClient.put(key, appProps.getRoutes());
            } catch (Exception e) {
                LOGGER.error("Error writing routes for app: " + appProps.getId(), e);
            }
        }
    }
View Full Code Here

Examples of net.raymanoz.config.ApplicationProperties

  }

  private void registerCommands(CmdLineArgumentsAndSwitches cmdln) {

    Properties uMigrateProperties = uMigrateProperties(cmdln);
    ApplicationProperties applicationProperties = new ApplicationPropertiesImpl(uMigrateProperties);
    FileUtil fileUtil = new FileUtilImpl(new StreamUtilImpl());
    ConfigurationImpl configuration = new ConfigurationImpl(applicationProperties, fileUtil, uMigrateProperties);
    ConditionHandlerListAssembler.setupConditions(configuration);
    CommandAssemblerImpl commandAssembler = new CommandAssemblerImpl(configuration);
    PlainProperties properties = new PlainProperties();
View Full Code Here

Examples of org.aavso.tools.vstar.util.property.ApplicationProperties

   * Create and display the main window.
   */
  private static void createAndShowGUI() {
    try {
      MainFrame frame = new MainFrame();
      final ApplicationProperties appProps = new ApplicationProperties(
          frame);

      frame.setSize(appProps.getMainWdwWidth(), appProps
          .getMainWdwHeight());
      frame.setLocation(appProps.getMainWdwUpperLeftX(), appProps
          .getMainWdwUpperLeftY());

      frame.setVisible(true);

      // We create a shutdown task rather than a window listener
      // to store application properties, otherwise on the Mac, we
      // would also have to trap the VStar (vs File) menu Quit item.
      // This shutdown task should work uniformly across operating
      // systems. The frame stored within appProps cannot be GC'd
      // until appProps is, so its state will still be valid at the
      // time run() is invoked.
      Runnable shutdownTask = new Runnable() {
        public void run() {
          appProps.update();
        }
      };

      Runtime.getRuntime().addShutdownHook(
          new Thread(shutdownTask, "Application shutdown task"));
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties

            sections.add(props);

            if(msgProps.getApplicationHeaders() != null)
            {
                sections.add(new ApplicationProperties(msgProps.getApplicationHeaders()));
            }
        }
        return new MessageMetaData_1_0(sections, sectionEncoder);
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties

            props.setUserId(new Binary(contentHeader.getUserId().getBytes()));
        }

        sections.add(props);

        sections.add(new ApplicationProperties(FieldTable.convertToMap(contentHeader.getHeaders())));

        return new MessageMetaData_1_0(sections, sectionEncoder);
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties

    {
        _header = header == null ? new Header() : header;
        _properties = properties == null ? new Properties() : properties;
        _messageAnnotations = messageAnnotations == null ? new MessageAnnotations(new HashMap()) : messageAnnotations;
        _footer = footer == null ? new Footer(Collections.EMPTY_MAP) : footer;
        _applicationProperties = appProperties == null ? new ApplicationProperties(new HashMap()) : appProperties;
        _sessionImpl = session;
    }
View Full Code Here

Examples of org.apache.qpid.amqp_1_0.type.messaging.ApplicationProperties

            Properties properties = new Properties();
            properties.setMessageId(java.util.UUID.randomUUID());
            properties.setReplyTo(responseReceiver.getAddress());

            HashMap appPropMap = new HashMap();
            ApplicationProperties appProperties = new ApplicationProperties(appPropMap);

            appPropMap.put(OPCODE, ANNOUNCE);
            appPropMap.put(VENDOR, vendor);
            appPropMap.put(ADDRESS,responseReceiver.getAddress());

            AmqpValue amqpValue = new AmqpValue(message);
            Section[] sections = { properties, appProperties, amqpValue};
            final Message message1 = new Message(Arrays.asList(sections));

            s.send(message1);

            Map<Object, Sender> sendingLinks = new HashMap<Object, Sender>();
            Map<Object, Receiver> receivingLinks = new HashMap<Object, Receiver>();


            boolean done = false;

            while(!done)
            {
                boolean wait = true;
                Message m = responseReceiver.receive(false);
                if(m != null)
                {
                    List<Section> payload = m.getPayload();
                    wait = false;
                    ApplicationProperties props = m.getApplicationProperties();
                    Map map = props.getValue();
                    String op = (String) map.get(OPCODE);
                    if("reset".equals(op))
                    {
                        for(Sender sender : sendingLinks.values())
                        {
                            try
                            {
                                sender.close();
                                Session session1 = sender.getSession();
                                session1.close();
                                session1.getConnection().close();
                            }
                            catch(Exception e)
                            {
                                e.printStackTrace();
                            }
                        }
                        for(Receiver receiver : receivingLinks.values())
                        {
                            try
                            {
                                receiver.close();
                                receiver.getSession().close();
                                receiver.getSession().getConnection().close();
                            }
                            catch(Exception e)
                            {
                                e.printStackTrace();
                            }
                        }
                        sendingLinks.clear();
                        receivingLinks.clear();
                    }
                    else if(CREATE_LINK.equals(op))
                    {
                        Object linkRef = map.get(LINK_REF);
                        String host = (String) map.get(HOST);
                        Object o = map.get(PORT);
                        int port = Integer.parseInt(String.valueOf(o));
                        String user = (String) map.get(SASL_USER);
                        String password = (String) map.get(SASL_PASSWORD);
                        String role = (String) map.get(ROLE);
                        String address = (String) map.get(ADDRESS);
                        System.err.println("Host: " + host + "\tPort: " + port + "\t user: " + user +"\t password: " + password);
                        try{


                            Connection conn2 = new Connection(host, port, user, password, host);
                            Session session2 = conn2.createSession();
                            if(sendingLinks.containsKey(linkRef))
                            {
                                try
                                {
                                    sendingLinks.remove(linkRef).close();
                                }
                                catch (Exception e)
                                {

                                }
                            }
                            if(receivingLinks.containsKey(linkRef))
                            {
                                try
                                {
                                    receivingLinks.remove(linkRef).close();
                                }
                                catch (Exception e)
                                {

                                }
                            }
                            if(SENDER.equals(role))
                            {

                                System.err.println("%%% Creating sender (" + linkRef + ")");
                                Sender sender = session2.createSender(address);
                                sendingLinks.put(linkRef, sender);
                            }
                            else
                            {

                                System.err.println("%%% Creating receiver (" + linkRef + ")");
                                Receiver receiver2 = session2.createReceiver(address);
                                receiver2.setCredit(UnsignedInteger.valueOf(getWindowSize()), true);

                                receivingLinks.put(linkRef, receiver2);
                            }
                        }
                        catch(Exception e)
                        {
                            e.printStackTrace();
                        }
                    }
                    else if(SEND_MESSAGE.equals(op))
                    {
                        Sender sender = sendingLinks.get(map.get(LINK_REF));
                        Properties m2props = new Properties();
                        Object messageId = map.get(MESSAGE_ID);
                        m2props.setMessageId(messageId);
                        Map m2propmap = new HashMap();
                        m2propmap.put(OPCODE, TEST);
                        m2propmap.put(VENDOR, vendor);
                        ApplicationProperties m2appProps = new ApplicationProperties(m2propmap);
                        Message m2 = new Message(Arrays.asList(m2props, m2appProps, new AmqpValue("AMQP-"+messageId)));
                        sender.send(m2);

                        Map m3propmap = new HashMap();
                        m3propmap.put(OPCODE, LOG);
                        m3propmap.put(ACTION, SENT);
                        m3propmap.put(MESSAGE_ID, messageId);
                        m3propmap.put(VENDOR, vendor);
                        m3propmap.put(MESSAGE_VENDOR, vendor);


                        Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
                                                               new AmqpValue("AMQP-"+messageId)));
                        s.send(m3);

                    }

                    responseReceiver.acknowledge(m);
                }
                else
                {
                    for(Map.Entry<Object, Receiver> entry : receivingLinks.entrySet())
                    {
                        m = entry.getValue().receive(false);
                        if(m != null)
                        {
                            wait = false;

                            System.err.println("%%% Received message from " + entry.getKey());

                            Properties mp = m.getProperties();
                            ApplicationProperties ap = m.getApplicationProperties();

                            Map m3propmap = new HashMap();
                            m3propmap.put(OPCODE, LOG);
                            m3propmap.put(ACTION, RECEIVED);
                            m3propmap.put(MESSAGE_ID, mp.getMessageId());
                            m3propmap.put(VENDOR, vendor);
                            m3propmap.put(MESSAGE_VENDOR, ap.getValue().get(VENDOR));

                            Message m3 = new Message(Arrays.asList(new ApplicationProperties(m3propmap),
                                                                   new AmqpValue("AMQP-"+mp.getMessageId())));
                            s.send(m3);

                            entry.getValue().acknowledge(m);
                        }
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.