/*
 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
/*************************************************************************
   Licensed Materials - Property of IBM
   WSEE1.0 (C) Copyright International Business Machines Corp. 2002
   All Rights Reserved.
   US Government Users Restricted Rights - Use, duplication or
   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
**************************************************************************/
/*************************************************************************
   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
   OR PERFORMANCE OF THIS SOFTWARE.
**************************************************************************/

/*
 * $Id: StockQuotePortTypeImpl.java 62536 2011-04-15 16:35:14Z af70133 $
 */

package com.sun.ts.tests.jaxrpc.ee.w2j.document.literal.stockquote;

import com.sun.ts.lib.util.*;
import com.sun.ts.lib.porting.*;

import java.rmi.Remote;
import java.rmi.RemoteException;

// Service Implementation Class - as outlined in JAX-RPC Specification

public class StockQuotePortTypeImpl implements StockQuotePortType {

    private static final float stockPrices[] = { -1.0f, 24.25f, 45.5f };
    private static final String STOCKSYMBOL1 = "GTE";
    private static final String STOCKSYMBOL2 = "GE";


    public float getLastTradePrice(String tickerSymbol) throws RemoteException
    {
	if (tickerSymbol.equals(STOCKSYMBOL1))
	    return stockPrices[1];
	else if (tickerSymbol.equals(STOCKSYMBOL2))
	    return stockPrices[2];
	else
	    return stockPrices[0];
    }
}
