/* * jws to test controls * * Copyright 2001-2004 The Apache Software Foundation. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * * Original author: James Song */ import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.rpc.server.ServletEndpointContext; import javax.xml.rpc.server.ServiceLifecycle; import org.apache.beehive.controls.api.bean.Control; import org.apache.beehive.controls.test.controls.instantiate.HelloControlBean; /******************************************************************************* * A WebService that test control instantiation * * @author James Song */ @WebService(name = "InstantiateControls", serviceName = "InstantiateControlsService", targetNamespace = "http://beehive.apache.org/controls/test") public class InstantiateControls implements ServiceLifecycle { @Control public HelloControlBean helloBean; private ServletEndpointContext mSec; public void init(Object sec) { mSec = (ServletEndpointContext)sec; } public void destroy() { mSec = null; } @WebMethod(action = "sayHello") @WebResult(name = "String") public String sayHello() { String result=helloBean.hello("Bob"); return result; } }