All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.jasmine.deployme.module.smartclient.Smartclient Maven / Gradle / Ivy

The newest version!
/**
 * JASMINe Deploy ME [Managed Element]
 * Copyright (C) 2012 Bull S.A.S.
 * Copyright (C) 2012 France Telecom R&D
 * Contact: [email protected]
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id: Smartclient.java 10000 2012-05-02 14:52:40Z cazauxj $
 * --------------------------------------------------------------------------
 */
package org.ow2.jasmine.deployme.module.smartclient;

import org.ow2.jasmine.deployme.module.AbstractDeploymeModule;
import org.ow2.jasmine.deployme.api.modules.UnsupportDeploymeModuleException;
import org.ow2.jonas.tools.configurator.api.JonasConfigurator;
import org.ow2.jasmine.deployme.v2.generated.SmartclientType;

/**
 * Smartclient module
 */
public class Smartclient extends AbstractDeploymeModule {

    /**
     * JOnAS service
     */
    public static final String JONAS_SERVICE = "smartclient";

    /**
     * {@inheritDoc}
     */
    public boolean isSupport(final Object configuration) {
        return SmartclientType.class.isInstance(configuration);
    }

    /**
     * {@inheritDoc}
     */
    public void applyConfiguration(final JonasConfigurator configurator, final Object object) throws UnsupportDeploymeModuleException {
        if (isSupport(object)) {
            SmartclientType configuration = SmartclientType.class.cast(object);
            if (configuration != null) {
                final String port = String.valueOf(configuration.getPort());
                if (port != null) {
                    configurator.setSmartClientPort(port);
                }
            }
        } else {
            throw new UnsupportDeploymeModuleException("Object " + object.getClass().getName() + " is not support");
        }
    }

    /**
     * {@inheritDoc}
     */
    public String getJOnASService() {
        return JONAS_SERVICE;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy