001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.axis2.jaxws.core;
020:
021: import org.apache.axis2.client.ServiceClient;
022: import org.apache.axis2.jaxws.client.async.AsyncResponse;
023:
024: import javax.xml.ws.handler.Handler;
025: import java.util.List;
026: import java.util.concurrent.Executor;
027:
028: /**
029: * An implementation of the InvocationContext interface.
030: *
031: * @see InvocationContext
032: */
033: public class InvocationContextImpl implements InvocationContext {
034:
035: private List<Handler> handlers;
036: private MessageContext requestMsgCtx;
037: private MessageContext responseMsgCtx;
038: private Executor executor;
039: private AsyncResponse asyncResponse;
040:
041: private ServiceClient serviceClient; //FIXME: This is temporary
042:
043: public InvocationContextImpl() {
044: //do nothing
045: }
046:
047: /** @see InvocationContext#getHandlers() */
048: public List<Handler> getHandlers() {
049: return handlers;
050: }
051:
052: /**
053: * Sets the list of hanlders for this InvocationContext
054: *
055: * @param list
056: */
057: public void setHandlers(List<Handler> handlers) {
058: this .handlers = handlers;
059: }
060:
061: /** @see InvocationContext#setRequestMessageContext(MessageContext) */
062: public void setRequestMessageContext(MessageContext ctx) {
063: requestMsgCtx = ctx;
064: if (ctx != null) {
065: requestMsgCtx.setInvocationContext(this );
066: }
067: }
068:
069: /** @see InvocationContext#setResponseMessageContext(MessageContext) */
070: public void setResponseMessageContext(MessageContext ctx) {
071: responseMsgCtx = ctx;
072: if (ctx != null) {
073: responseMsgCtx.setInvocationContext(this );
074: }
075: }
076:
077: /** @see InvocationContext#getResponseMessageContext() */
078: public MessageContext getResponseMessageContext() {
079: return responseMsgCtx;
080: }
081:
082: /** @see InvocationContext#getRequestMessageContext() */
083: public MessageContext getRequestMessageContext() {
084: return requestMsgCtx;
085: }
086:
087: public Executor getExecutor() {
088: return executor;
089: }
090:
091: public void setExecutor(Executor e) {
092: executor = e;
093: }
094:
095: public AsyncResponse getAsyncResponseListener() {
096: return asyncResponse;
097: }
098:
099: public void setAsyncResponseListener(AsyncResponse ar) {
100: asyncResponse = ar;
101: }
102:
103: // FIXME: This is temporary
104: public ServiceClient getServiceClient() {
105: return serviceClient;
106: }
107:
108: // FIXME: This is temporary
109: public void setServiceClient(ServiceClient client) {
110: serviceClient = client;
111: }
112: }
|