KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > policy > ServiceBehaviourBinding


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.policy;
18
19
20 /**
21  * Behaviour binding to a Service.
22  *
23  * @author David Caruana
24  *
25  */

26 public class ServiceBehaviourBinding implements BehaviourBinding
27 {
28     // The service
29
private Object JavaDoc service;
30
31     /**
32      * Construct
33      *
34      * @param service the service
35      */

36     /*package*/ ServiceBehaviourBinding(Object JavaDoc service)
37     {
38         this.service = service;
39     }
40     
41     /* (non-Javadoc)
42      * @see org.alfresco.repo.policy.BehaviourBinding#generaliseBinding()
43      */

44     public BehaviourBinding generaliseBinding()
45     {
46         return null;
47     }
48     
49     /**
50      * Gets the Service
51      *
52      * @return the service
53      */

54     public Object JavaDoc getService()
55     {
56         return service;
57     }
58
59     @Override JavaDoc
60     public boolean equals(Object JavaDoc obj)
61     {
62         if (obj == null || !(obj instanceof ServiceBehaviourBinding))
63         {
64             return false;
65         }
66         return service.equals(((ServiceBehaviourBinding)obj).service);
67     }
68
69     @Override JavaDoc
70     public int hashCode()
71     {
72         return service.hashCode();
73     }
74
75     @Override JavaDoc
76     public String JavaDoc toString()
77     {
78         return "ServiceBinding[service=" + this + "]";
79     }
80
81 }
82
Popular Tags