KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > api > jaxws > project > config > HandlerChains


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

27
28 package org.netbeans.modules.websvc.api.jaxws.project.config;
29
30 import java.beans.PropertyChangeListener JavaDoc;
31 import java.io.OutputStream JavaDoc;
32 import org.netbeans.modules.schema2beans.BaseBean;
33 /**
34  *
35  * @author Roderico Cruz
36  */

37 public class HandlerChains {
38      private org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChains handlerChains;
39     /** Creates a new instance of HandlerChains */
40     public HandlerChains(org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChains handlerChains) {
41         this.handlerChains = handlerChains;
42     }
43     
44     public HandlerChain[] getHandlerChains() {
45         org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChain[] chains = handlerChains.getHandlerChain();
46         HandlerChain[] newChains = new HandlerChain[chains.length];
47         for (int i=0;i<chains.length;i++) {
48             newChains[i]=new HandlerChain(chains[i]);
49         }
50         return newChains;
51     }
52     
53     public HandlerChain newChain() {
54         org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChain chain = handlerChains.newHandlerChain();
55         return new HandlerChain(chain);
56     }
57     
58     public void addHandlerChain(String JavaDoc handlerName, HandlerChain chain) {
59         handlerChains.addHandlerChain((org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChain)chain.getOriginal());
60     }
61     
62     public void removeHandlerChain(HandlerChain chain) {
63         handlerChains.removeHandlerChain((org.netbeans.modules.websvc.jaxwsmodel.handler_config1_0.HandlerChain)chain.getOriginal());
64     }
65     
66     public HandlerChain findHandlerChainByName(String JavaDoc handlerChainName) {
67         HandlerChain[] chains = getHandlerChains();
68         for (int i=0;i<chains.length;i++) {
69             if (handlerChainName.equals(chains[i].getHandlerChainName())) return chains[i];
70         }
71         return null;
72     }
73     
74     public void addPropertyChangeListener(PropertyChangeListener JavaDoc l) {
75         handlerChains.addPropertyChangeListener(l);
76     }
77     
78     public void removePropertyChangeListener(PropertyChangeListener JavaDoc l) {
79         handlerChains.removePropertyChangeListener(l);
80     }
81     
82     public void merge(HandlerChains newChains) {
83         if (newChains.handlerChains!=null)
84             handlerChains.merge(newChains.handlerChains,BaseBean.MERGE_UPDATE);
85     }
86     
87     public void write(OutputStream JavaDoc os) throws java.io.IOException JavaDoc {
88         handlerChains.write(os);
89     }
90     
91 }
92
Popular Tags