View Javadoc

1   /*
2    * Copyright  2004 The Apache Software Foundation.
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package org.apache.kandula.context.impl;
18  
19  import org.apache.axis2.addressing.EndpointReference;
20  import org.apache.kandula.Constants;
21  import org.apache.kandula.Status;
22  import org.apache.kandula.context.AbstractContext;
23  import org.apache.kandula.participant.KandulaResource;
24  
25  /***
26   * @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
27   */
28  public class ATParticipantContext extends AbstractContext {
29  	KandulaResource resource;
30  	
31  	public ATParticipantContext() {
32  		this.setStatus(Status.CoordinatorStatus.STATUS_ACTIVE);
33  	}
34  	
35  	public EndpointReference getCoordinationEPR() {
36  		return (EndpointReference) getProperty(ATActivityContext.COORDINATION_EPR);
37  	}
38  	
39  	/*
40  	 * (non-Javadoc)
41  	 * 
42  	 * @see org.apache.kandula.context.AbstractContext#getCoordinationType()
43  	 */
44  	public String getCoordinationType() {
45  		return Constants.WS_AT;
46  	}
47  	
48  	/***
49  	 * @return Returns the transaction partcipant resource.
50  	 */
51  	public KandulaResource getResource() {
52  		return resource;
53  	}
54  	
55  	/***
56  	 * @param setting the transaction participant resource
57  	 */
58  	public void setResource(KandulaResource resource) {
59  		this.resource = resource;
60  	}
61  
62  	public String getRegistrationProtocol() {
63  		return resource.getProtocol();
64  	}
65  	
66  }