Search in sources :

Example 16 with Version

use of com.sun.messaging.jmq.Version in project openmq by eclipse-ee4j.

the class AboutDialog method makeRightPanel.

private JPanel makeRightPanel() {
    Version version;
    JPanel rightPanel;
    GridBagLayout gridbag;
    GridBagConstraints c;
    JLabel label;
    JSeparator sep;
    LabelValuePanel lvp;
    LabelledComponent[] lvpItems;
    LabelledComponent tmpLabelC;
    JTextArea ta;
    JScrollPane sp;
    int gridy = 0, width;
    version = new Version(false);
    rightPanel = new JPanel();
    gridbag = new GridBagLayout();
    rightPanel.setLayout(gridbag);
    c = new GridBagConstraints();
    label = new JLabel(version.getProductName() + " " + version.getReleaseQID());
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    label = new JLabel(acr.getString(acr.I_VERSION, version.getBuildVersion()));
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    label = new JLabel(acr.getString(acr.I_COMPILE, version.getBuildDate()));
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    sep = new JSeparator();
    c.gridx = 0;
    c.gridy = gridy++;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(5, 0, 5, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sep, c);
    rightPanel.add(sep);
    /*
         * Reset
         */
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(0, 0, 0, 0);
    label = new JLabel(acr.getString(acr.I_VERSION_INFO, version.getVersionPackageName()));
    c.gridx = 0;
    gridy++;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    /*
         * Reset
         */
    c.insets = new Insets(0, 0, 0, 0);
    String[] patchids = version.getPatchIds();
    if (patchids == null || patchids.length < 1) {
        lvpItems = new LabelledComponent[3];
    } else {
        lvpItems = new LabelledComponent[4];
    }
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_IMPLEMENTATION), new JLabel(version.getImplementationVersion()));
    lvpItems[0] = tmpLabelC;
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_PROTOCOL_VERSION), new JLabel(version.getProtocolVersion()));
    lvpItems[1] = tmpLabelC;
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_TARGET_JMS_VERSION), new JLabel(version.getTargetJMSVersion()));
    lvpItems[2] = tmpLabelC;
    // The Patchids are listed in a panel on the right.
    if (patchids != null && patchids.length >= 1) {
        JPanel patchPanel = new JPanel();
        GridBagLayout gb = new GridBagLayout();
        patchPanel.setLayout(gb);
        GridBagConstraints c2 = new GridBagConstraints();
        for (int p = 0; p < patchids.length; p++) {
            c2.gridx = 0;
            c2.gridy = p;
            c2.ipadx = 0;
            c2.ipady = 0;
            c2.anchor = GridBagConstraints.WEST;
            JLabel patchLabel = new JLabel(patchids[p]);
            gb.setConstraints(patchLabel, c2);
            patchPanel.add(patchLabel);
        }
        tmpLabelC = new LabelledComponent(acr.getString(acr.I_PATCHES), patchPanel, LabelledComponent.NORTH);
        lvpItems[3] = tmpLabelC;
    }
    lvp = new LabelValuePanel(lvpItems, 4, 0);
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(lvp, c);
    rightPanel.add(lvp);
    label = new JLabel(acr.getString(acr.I_JAVA_VERSION) + System.getProperty("java.version") + " " + System.getProperty("java.vendor") + " " + System.getProperty("java.home"));
    c.gridx = 0;
    c.gridy = gridy++;
    c.insets = new Insets(5, 0, 0, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    String classpathStr = System.getProperty("java.class.path");
    classpathStr = classpathStr.replace(File.pathSeparatorChar, '\n');
    ta = new JTextArea(classpathStr);
    ta.setEditable(false);
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    Color bgColor = rightPanel.getBackground();
    ta.setBackground(bgColor);
    Color fgColor = label.getForeground();
    ta.setForeground(fgColor);
    ta.setFont(label.getFont());
    width = label.getPreferredSize().width;
    ta.setSize(width, 1);
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_JAVA_CLASSPATH), ta, LabelledComponent.NORTH);
    c.gridx = 0;
    c.gridy = gridy++;
    c.insets = new Insets(0, 0, 0, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(tmpLabelC, c);
    rightPanel.add(tmpLabelC);
    sep = new JSeparator();
    c.gridx = 0;
    c.gridy = gridy++;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(5, 0, 5, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sep, c);
    rightPanel.add(sep);
    /*
         * Reset
         */
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(0, 0, 0, 0);
    ta = new JTextArea(version.getCopyright(Version.SHORT_COPYRIGHT), 8, 0);
    ta.setEditable(false);
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    bgColor = rightPanel.getBackground();
    ta.setBackground(bgColor);
    fgColor = label.getForeground();
    ta.setForeground(fgColor);
    ta.setFont(label.getFont());
    // width = label.getPreferredSize().width;
    width = rightPanel.getPreferredSize().width;
    ta.setSize(width, 1);
    sp = new JScrollPane(ta);
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sp, c);
    rightPanel.add(sp);
    label = new JLabel(acr.getString(acr.I_RSA_CREDIT));
    c.gridx = 0;
    c.gridy = gridy++;
    c.ipady = 10;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    return rightPanel;
}
Also used : LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) JTextArea(javax.swing.JTextArea) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) Color(java.awt.Color) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator) LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) Version(com.sun.messaging.jmq.Version)

Example 17 with Version

use of com.sun.messaging.jmq.Version in project openmq by eclipse-ee4j.

the class ResourceAdapter method start.

// ResourceAdapter interface methods //
// 
/**
 * <p>
 * Starts this instance of the Resource Adapter. <br>
 * <p>
 * If this resource adapter is configured to perform broker lifecycle management
 * (i.e.<tt>setManageBrokerLifecycle(false)</tt> has not been called) and the configured broker type is not
 * <tt>REMOTE</tt>, then this also starts the managed broker.
 */
@Override
public synchronized void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
    _loggerL.entering(_className, "start()", ctx);
    JMSRAResourceAdapter.init();
    if (started) {
        _loggerL.warning(_lgrMID_WRN + "start:Previously started:Ignoring");
    } else {
        fixBrokerType();
        Version version = new Version();
        _loggerL.info(_lgrMID_INF + "GlassFish MQ JMS Resource Adapter: " + version.getRAVersion());
        _loggerL.info(_lgrMID_INF + "GlassFish MQ JMS Resource Adapter starting: broker is " + getPublicBrokerType() + ", connection mode is " + getPublicConnectionType());
        this.b_context = ctx;
        if (b_context != null) {
            workMgr = b_context.getWorkManager();
        }
        // Try to set inAppClientContainer correctly
        _adjustInAppClientContainer();
        this.xacf = new com.sun.messaging.XAConnectionFactory();
        AccessController.doPrivileged(new PrivilegedAction<Object>() {

            @Override
            public Object run() {
                System.setProperty("imq.DaemonThreads", "true");
                return null;
            }
        });
        // if we have been configured to start a managed broker, start it
        if (isManageBrokerLifecycle() && !this._isRemote()) {
            getLifecycleManagedBroker().start();
        }
        try {
            // Configure RA ConnectionFactory
            // will throw a JMSException if the properties are invalid
            configureFactory();
        } catch (JMSException jmse) {
            // If we have just started a local broker then stop it
            if (getLifecycleManagedBroker().isStarted() && getLifecycleManagedBroker().isLocal()) {
                getLifecycleManagedBroker().stop();
            }
            ResourceAdapterInternalException raie = new ResourceAdapterInternalException(_lgrMID_EXC + "start:Aborting:JMSException on createConnection=" + jmse.getMessage());
            raie.initCause(jmse);
            _loggerL.severe(raie.getMessage());
            jmse.printStackTrace();
            _loggerL.throwing(_className, "start()", raie);
            throw raie;
        }
        /* init hash maps */
        epFactories = new HashMap<>(10);
        epConsumers = new HashMap<>(10);
        epFactoryToConsumer = new HashMap<>(10);
        _setOnMessageMethod();
        started = true;
        _loggerL.config(_lgrMID_INF + toString());
        _loggerL.config(_lgrMID_INF + "start:SJSMQ JMSRA Connection Factory Config=" + xacf.getCurrentConfiguration());
        _loggerL.info(_lgrMID_INF + "GlassFish MQ JMS Resource Adapter Started:" + getPublicBrokerType());
    }
    _loggerL.exiting(_className, "start()");
}
Also used : Version(com.sun.messaging.jmq.Version) JMSException(jakarta.jms.JMSException) ResourceAdapterInternalException(jakarta.resource.spi.ResourceAdapterInternalException)

Aggregations

Version (com.sun.messaging.jmq.Version)17 LabelValuePanel (com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel)1 LabelledComponent (com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent)1 Queue (com.sun.messaging.jmq.jmsserver.core.Queue)1 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)1 JMSException (jakarta.jms.JMSException)1 ResourceAdapterInternalException (jakarta.resource.spi.ResourceAdapterInternalException)1 Color (java.awt.Color)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Properties (java.util.Properties)1 Set (java.util.Set)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JSeparator (javax.swing.JSeparator)1 JTextArea (javax.swing.JTextArea)1