Example usage for java.beans PropertyVetoException getMessage

List of usage examples for java.beans PropertyVetoException getMessage

Introduction

In this page you can find the example usage for java.beans PropertyVetoException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.mashupmedia.initialise.MashupMediaServiceLocator.java

public DataSource createDataSource() {
    ComboPooledDataSource dataSource = new ComboPooledDataSource();
    try {// w  w w  .j  av a  2 s  .co m
        dataSource.setDriverClass("org.hsqldb.jdbcDriver");
    } catch (PropertyVetoException e) {
        throw new MashupMediaRuntimeException(e.getMessage());
    }
    String applicationFolderPath = FileHelper.getApplicationFolder().getAbsolutePath();
    //      dataSource.setJdbcUrl("jdbc:hsqldb:file:" + applicationFolderPath + "/db;shutdown=true;hsqldb.write_delay_millis=0;hsqldb.tx=mvcc");
    dataSource.setJdbcUrl(
            "jdbc:hsqldb:file:" + applicationFolderPath + "/db;shutdown=true;hsqldb.write_delay_millis=0");
    dataSource.setUser("sa");
    dataSource.setPassword("");
    dataSource.setMinPoolSize(2);
    dataSource.setMaxPoolSize(5);
    dataSource.setMaxIdleTime(600);

    return dataSource;
}

From source file:com.flipkart.aesop.hbasedatalayer.AbstractHBaseDataLayerFactory.java

private DataSource getDataSource() {
    ComboPooledDataSource comboPooledDataSource = null;
    try {// w w w.j a v  a 2s  . c o m
        comboPooledDataSource = new ComboPooledDataSource();
        comboPooledDataSource.setDriverClass(getDriverClass());
        comboPooledDataSource.setJdbcUrl(getJdbcUrl());
        comboPooledDataSource.setProperties(getDataSourceProperties());
    } catch (PropertyVetoException e) {
        LOGGER.error(e.getMessage());
    }

    return comboPooledDataSource;

}

From source file:ca.uhn.hunit.msg.Hl7V2MessageImpl.java

public Hl7V2MessageImpl(Hl7V2MessageDefinition theConfig) throws ConfigurationException {
    super(theConfig);

    try {//from w w w.  j a  v  a 2 s. co  m
        setSourceMessage(theConfig.getText());
    } catch (PropertyVetoException ex) {
        throw new ConfigurationException(ex.getMessage(), ex);
    }
}

From source file:ca.uhn.hunit.swing.ui.util.BeanDefinitionForm.java

public void setController(IBeanDefinitionController theController) {
    myController = theController;/*from   w  w w . j  av  a2 s .  c  om*/

    myConstructorArgsTableModel = theController.getConstructorArgsTableModel();
    myConstructorArgsTable.setModel(myConstructorArgsTableModel);

    myConstructorComboBoxModel = new MyConstructorComboBoxModel();
    myConstructorComboBox.setModel(myConstructorComboBoxModel);

    mySelectedClass = theController.getInitialClass();

    if (mySelectedClass != null) {
        myConnectionFactoryTextBox.setText(mySelectedClass.getName());
    } else {
        myConnectionFactoryTextBox.setText("");
    }

    myConstructorComboBoxModel.updateForClass(mySelectedClass);

    myConstructorComboBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            List<Class<?>> types = myConstructorComboBoxModel.getSelectedTypes();
            myConstructorArgsTableModel.setTypes(types);
        }
    });

    myConnectionFactoryTextBox.getDocument().addUndoableEditListener(new UndoableEditListener() {
        @Override
        public void undoableEditHappened(UndoableEditEvent e) {
            final Class<?> clazz;

            try {
                clazz = Class.forName(myConnectionFactoryTextBox.getText());
                myConnectionFactoryTextBox.setBackground(Colours.getTextFieldOk());
                myController.setSelectedClass(clazz);
            } catch (PropertyVetoException ex) {
                myLog.error(ex.getMessage());
                myConnectionFactoryTextBox.setBackground(Colours.getTextFieldError());
            } catch (ClassNotFoundException ex) {
                myLog.error(ex.getMessage());
                myConnectionFactoryTextBox.setBackground(Colours.getTextFieldError());
            }
        }
    });
}

From source file:ca.uhn.hunit.swing.ui.iface.JmsInterfaceForm.java

/**
 * {@inheritDoc }//from ww w  .  ja v a 2s  .com
 */
@Override
public void setController(JmsInterfaceContextController theController) {
    final JmsInterfaceImpl model = theController.getModel();

    myUsernameTextBox.setText(model.getUsername());
    myUsernameTextBox.getDocument().addUndoableEditListener(new UndoableEditListener() {

        public void undoableEditHappened(UndoableEditEvent e) {
            model.setUsername(myUsernameTextBox.getText());
        }
    });

    myPasswordTextBox.setText(model.getPassword());
    myPasswordTextBox.getDocument().addUndoableEditListener(new UndoableEditListener() {

        public void undoableEditHappened(UndoableEditEvent e) {
            model.setPassword(myPasswordTextBox.getText());
        }
    });

    myQueueNameTextBox.setText(model.getQueueName());
    if (StringUtils.isBlank(model.getQueueName())) {
        myQueueNameTextBox.setBackground(Colours.getTextFieldError());
    }
    myQueueNameTextBox.getDocument().addUndoableEditListener(new UndoableEditListener() {

        @Override
        public void undoableEditHappened(UndoableEditEvent e) {
            try {
                model.setQueueName(myQueueNameTextBox.getText());
                myQueueNameTextBox.setBackground(Colours.getTextFieldOk());
            } catch (PropertyVetoException ex) {
                LogFactory.INSTANCE.getSystem(getClass()).error(ex.getMessage());
                myQueueNameTextBox.setBackground(Colours.getTextFieldError());
            }
        }
    });

    myQueueTopicCombo.setSelectedIndex(model.isPubSubDomain() ? 1 : 0);
    myQueueTopicCombo.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            model.setPubSubDomain(myQueueTopicCombo.getSelectedIndex() == 1);
        }
    });

    myConnectionFactoryBeanEditor.setController(theController.getConstructorArgsController());
}

From source file:org.jfree.data.general.Series.java

/**
 * Sets the key for the series and sends a <code>VetoableChangeEvent</code>
 * (with the property name "Key") to all registered listeners.  For 
 * backwards compatibility, this method also fires a regular 
 * <code>PropertyChangeEvent</code>.  If the key change is vetoed this 
 * method will throw an IllegalArgumentException.
 *
 * @param key  the key (<code>null</code> not permitted).
 *
 * @see #getKey()// ww  w. j a  v a  2 s .com
 */
public void setKey(Comparable key) {
    ParamChecks.nullNotPermitted(key, "key");
    Comparable old = this.key;
    try {
        // if this series belongs to a dataset, the dataset might veto the
        // change if it results in two series within the dataset having the
        // same key
        this.vetoableChangeSupport.fireVetoableChange("Key", old, key);
        this.key = key;
        // prior to 1.0.14, we just fired a PropertyChange - so we need to
        // keep doing this
        this.propertyChangeSupport.firePropertyChange("Key", old, key);
    } catch (PropertyVetoException e) {
        throw new IllegalArgumentException(e.getMessage());
    }
}

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void activateInternalFrame(String panelName) {
    JInternalFrame[] frames = desktop.getAllFrames();
    for (JInternalFrame frame : frames) {
        if (frame.getName().equals(panelName)) {
            frame.moveToFront();/*from  w w w .j  a v  a 2 s  .  co m*/
            //desktop.getDesktopManager().deactivateFrame(frame);
            desktop.getDesktopManager().activateFrame(frame);
            try {
                frame.setSelected(true);
                menuController.setActiveFrameName(frame.getName());
            } catch (PropertyVetoException e) {
                log.error(e.getMessage(), e);
            }
        } else {
            frame.moveToBack();
        }
    }
}

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void minimizeAllFrames() {
    Object[] obj = frameMap.values().toArray();
    for (Object oframe : obj) {
        JInternalFrame frame = (JInternalFrame) oframe;
        desktop.getDesktopManager().iconifyFrame(frame);
        frame.setResizable(true);//w  ww . j ava  2  s  . co m
        frame.setMaximizable(true);
        try {
            frame.setIcon(true);
        } catch (PropertyVetoException e) {
            log.error(e.getMessage(), e);
        }
    }
}

From source file:org.en.tealEye.guiMain.MainAppFrame.java

public void normalizeAllFrames() {
    Collection<JInternalFrame> obj = frameMap.values();
    int i = 0;//from w  w  w  . j  av a  2  s. com
    for (JInternalFrame oframe : obj) {
        if (oframe.isIcon())
            try {
                desktop.getDesktopManager().deiconifyFrame(oframe);
                oframe.setIcon(false);

            } catch (PropertyVetoException e) {
                log.error(e.getMessage(), e);
            }
        desktop.getDesktopManager().resizeFrame(oframe, i, i, 450, 450);
        desktop.getDesktopManager().activateFrame(oframe);
        try {
            oframe.setSelected(false);
        } catch (PropertyVetoException e) {
            log.error(e.getMessage(), e);
        }
        oframe.moveToFront();
        i = i + 10;
    }
}

From source file:org.opencastproject.ingest.endpoint.IngestRestServiceTest.java

public void setupAndTestIngestingLimit(String limit, int numberOfIngests, int expectedOK, int expectedBusy) {
    try {//from   ww  w. j  a v a2  s .c om
        setupPooledDataSource();
    } catch (PropertyVetoException e) {
        Assert.fail("Test failed due to exception " + e.getMessage());
    }

    Map<String, Object> props = setupPersistenceProperties();

    restService = new IngestRestService();
    restService.setPersistenceProvider(new PersistenceProvider());
    restService.setPersistenceProperties(props);
    restService.setIngestService(setupAddZippedMediaPackageIngestService());
    restService.activate(setupAddZippedMediaPackageComponentContext(limit));

    limitVerifier = new LimitVerifier(numberOfIngests);
    limitVerifier.start();

    Assert.assertEquals("There should be no errors when making requests.", 0, limitVerifier.getError());
    Assert.assertEquals("There should have been the same number of successful ingests finished as expected.",
            expectedOK, limitVerifier.getOk());
    Assert.assertEquals("The extra ingests beyond the limit should have received a server unavailable error. ",
            expectedBusy, limitVerifier.getUnavailable());
}