KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > serviceapi > ServiceComponent


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.serviceapi;
20
21 import java.beans.PropertyChangeListener JavaDoc;
22 import java.beans.PropertyChangeSupport JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.List JavaDoc;
25 import org.openide.nodes.Node;
26
27 /**
28  * Represents an implementation unit corresponding of one or multiple
29  * service interfaces, co-locate in a single implementation unit such as a plain
30  * Java class, a BPEL process, an EJB or Servlet.
31  *
32  * @author Nam Nguyen
33  * @author Chris Webster
34  * @author Jiri Kopsa
35  */

36 public abstract class ServiceComponent {
37
38     public static final String JavaDoc SERVICE_INTERFACE_ADDED_PROPERTY = "serviceInterfaceAdded";
39     public static final String JavaDoc SERVICE_INTERFACE_REMOVED_PROPERTY = "serviceInterfaceRemoved";
40     
41     private PropertyChangeSupport JavaDoc propSupport;
42     /**
43      * Add property change listener.
44      */

45     public void addPropertyChangeListener(PropertyChangeListener JavaDoc listener) {
46         propSupport.addPropertyChangeListener(listener);
47     }
48     /**
49      * Remove property change listener.
50      */

51     public void removePropertyChangeListener(PropertyChangeListener JavaDoc listener) {
52         propSupport.removePropertyChangeListener(listener);
53     }
54
55     /**
56      * Returns the service interfaces this component provides
57      * the implementation for.
58      */

59     public abstract List JavaDoc<ServiceInterface> getServiceProviders();
60     /**
61      * Returns the service interfaces this component consumes.
62      */

63     public abstract List JavaDoc<ServiceInterface> getServiceConsumers();
64     
65     /**
66      * Returns the service coordination information if applicable.
67      */

68     public abstract Collection JavaDoc<ServiceLink> getServiceLinks();
69     
70     /**
71      * Returns the visualization of the service component. The node should provide
72      * navigation to the component editors and access to its content.
73      * @return visualization node for the service component.
74      */

75     public abstract Node getNode();
76     
77     //CR: where should Categorization and CategorizationProvider come from
78

79     /**
80      * Ensures this component provide for or consume the given interface.
81      *
82      * @param description the interface to create consumer or provider service for.
83      * @provider whether the service interface to create is provider or consumer.
84      * @return the service interface object.
85      */

86     public abstract ServiceInterface createServiceInterface(InterfaceDescription description, boolean provider);
87  
88     /**
89      * Creates the counter-part service interface of the given service interface.
90      */

91     public abstract ServiceInterface createServiceInterface(ServiceInterface other);
92     
93     /**
94      * Removes service interface from this component. Will also remove
95      * any associated connections from the containing service module container.
96      * Note that the related service interfaces and service links are not removed.
97      */

98     public abstract void removeServiceInterface(ServiceInterface serviceInterface);
99
100 }
101
Popular Tags