KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > service > BeanServiceDescriptor


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.service;
18
19 import java.util.Collection JavaDoc;
20
21 import org.alfresco.service.ServiceDescriptor;
22 import org.alfresco.service.cmr.repository.StoreRef;
23 import org.alfresco.service.namespace.QName;
24
25
26 /**
27  * Service Descriptor.
28  *
29  * @author David Caruana
30  */

31 public class BeanServiceDescriptor
32     implements ServiceDescriptor
33 {
34     // Service Name
35
private QName serviceName;
36
37     // Service Description
38
private String JavaDoc description;
39
40     // Service interface class
41
private Class JavaDoc interfaceClass;
42
43     // Supported Store Protocols
44
Collection JavaDoc<String JavaDoc> protocols = null;
45
46     // Supported Stores
47
Collection JavaDoc<StoreRef> stores = null;
48
49     
50     /*package*/ BeanServiceDescriptor(QName serviceName, ServiceDescriptorMetaData metaData, StoreRedirector redirector)
51     {
52         this.serviceName = serviceName;
53         this.interfaceClass = metaData.getInterface();
54         this.description = metaData.getDescription();
55
56         if (redirector != null)
57         {
58             protocols = redirector.getSupportedStoreProtocols();
59             stores = redirector.getSupportedStores();
60         }
61     }
62     
63     /* (non-Javadoc)
64      * @see org.alfresco.service.ServiceDescriptor#getQualifiedName()
65      */

66     public QName getQualifiedName()
67     {
68         return serviceName;
69     }
70
71     /* (non-Javadoc)
72      * @see org.alfresco.service.ServiceDescriptor#getDescription()
73      */

74     public String JavaDoc getDescription()
75     {
76         return description;
77     }
78
79     /* (non-Javadoc)
80      * @see org.alfresco.service.ServiceDescriptor#getInterface()
81      */

82     public Class JavaDoc getInterface()
83     {
84         return interfaceClass;
85     }
86
87     /* (non-Javadoc)
88      * @see org.alfresco.service.ServiceDescriptor#getSupportedStoreProtocols()
89      */

90     public Collection JavaDoc<String JavaDoc> getSupportedStoreProtocols()
91     {
92         return protocols;
93     }
94
95     /* (non-Javadoc)
96      * @see org.alfresco.repo.service.StoreRedirector#getSupportedStores()
97      */

98     public Collection JavaDoc<StoreRef> getSupportedStores()
99     {
100         return stores;
101     }
102    
103 }
104
Popular Tags