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

org.ow2.cmi.test.LatestPolicy Maven / Gradle / Ivy

/**
 * CMI : Cluster Method Invocation
 * Copyright (C) 2008 Bull S.A.S.
 * 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 (at your option) 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 * --------------------------------------------------------------------------
 * $Id: LatestPolicy.java 2438 2010-02-24 16:20:30Z benoitf $
 * --------------------------------------------------------------------------
 */

package org.ow2.cmi.test;

import java.net.URL;
import java.util.Collection;
import java.util.List;

import org.ow2.cmi.lb.LoadBalanceable;
import org.ow2.cmi.lb.NoLoadBalanceableException;
import org.ow2.cmi.lb.policy.AbstractPolicy;

/**
 * @param 
 * @author Loris Bouzonnet
 */
@SuppressWarnings("unchecked")
public class LatestPolicy extends AbstractPolicy {

    private String prop1;

    private int prop2;

    private List prop3;

    private List> prop4;

    private List prop5;

    @Override
    public T choose(final Collection loadBalanceables)
            throws NoLoadBalanceableException {
        return (T) loadBalanceables.toArray()[loadBalanceables.size() - 1];
    }

    public String getProp1() {
        return prop1;
    }

    public void setProp1(final String prop1) {
        this.prop1 = prop1;
    }

    public int getProp2() {
        return prop2;
    }

    public void setProp2(final int prop2) {
        this.prop2 = prop2;
    }

    public List getProp3() {
        return prop3;
    }

    public void setProp3(final List prop3) {
        this.prop3 = prop3;
    }

    public List> getProp4() {
        return prop4;
    }

    public void setProp4(final List> prop4) {
        this.prop4 = prop4;
    }

    public List getProp5() {
        return prop5;
    }

    public void setProp5(final List prop5) {
        this.prop5 = prop5;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy