This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 66379
Collapse All | Expand All

(-)apichanges.xml (+26 lines)
Lines 80-85 Link Here
80
    <!-- ACTUAL CHANGES BEGIN HERE: -->
80
    <!-- ACTUAL CHANGES BEGIN HERE: -->
81
81
82
    <changes>
82
    <changes>
83
        <change id="resourceDirUpdate">
84
            <api name="j2eeserver"/>
85
            <summary>
86
                Support for updating module enterprise resource directory added.
87
            </summary>
88
            <version major="1" minor="12"/>
89
            <date day="10" month="10" year="2005"/>
90
            <author login="sherold"/>
91
            <compatibility binary="incompatible" source="incompatible" semantic="incompatible" addition="yes"/>
92
            <description>
93
                <p>
94
                    Plugins need to be notified when the module enterprise resource
95
                    directory changes.
96
                </p>
97
                <p>
98
                    Property PROP_ENTERPRISE_RESOURCE_DIRECTORY and property change 
99
                    listener added to J2eeModuleProvider.
100
                </p>
101
                <p>
102
                    Abstract method updateResourceDir(DeploymentConfiguration config, File resourceDir)
103
                    added to ConfigurationSupport.
104
                </p>
105
            </description>
106
            <class package="org.netbeans.modules.j2ee.deployment.devmodules.spi" name="J2eeModuleProvider"/>
107
            <class package="org.netbeans.modules.j2ee.deployment.plugins.api" name="ConfigurationSupport"/>
108
        </change>
83
        <change id="profilerSupport">
109
        <change id="profilerSupport">
84
            <api name="j2eeserver"/>
110
            <api name="j2eeserver"/>
85
            <summary>
111
            <summary>
(-)manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.j2eeserver/4
2
OpenIDE-Module: org.netbeans.modules.j2eeserver/4
3
OpenIDE-Module-Specification-Version: 1.11
3
OpenIDE-Module-Specification-Version: 1.12
4
OpenIDE-Module-Layer: org/netbeans/modules/j2ee/deployment/impl/layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/j2ee/deployment/impl/layer.xml
5
OpenIDE-Module-Install: org/netbeans/modules/j2ee/deployment/impl/Install.class
5
OpenIDE-Module-Install: org/netbeans/modules/j2ee/deployment/impl/Install.class
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/deployment/impl/Bundle.properties
6
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/deployment/impl/Bundle.properties
(-)src/org/netbeans/modules/j2ee/deployment/config/ConfigSupportImpl.java (-1 / +18 lines)
Lines 12-17 Link Here
12
 */
12
 */
13
13
14
package org.netbeans.modules.j2ee.deployment.config;
14
package org.netbeans.modules.j2ee.deployment.config;
15
16
import java.beans.PropertyChangeEvent;
17
import java.beans.PropertyChangeListener;
15
import java.io.File;
18
import java.io.File;
16
import java.io.IOException;
19
import java.io.IOException;
17
import java.io.OutputStream;
20
import java.io.OutputStream;
Lines 57-63 Link Here
57
// case when provider does not associate with any server.
60
// case when provider does not associate with any server.
58
61
59
public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport, 
62
public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport, 
60
        DeploymentConfigurationProvider {
63
        DeploymentConfigurationProvider, PropertyChangeListener {
61
    
64
    
62
    private static final File[] EMPTY_FILE_LIST = new File[0];
65
    private static final File[] EMPTY_FILE_LIST = new File[0];
63
    private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N
66
    private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N
Lines 81-86 Link Here
81
        server = instance != null 
84
        server = instance != null 
82
                ? instance.getServer() 
85
                ? instance.getServer() 
83
                : ServerRegistry.getInstance().getServer(provider.getServerID());
86
                : ServerRegistry.getInstance().getServer(provider.getServerID());
87
        provider.addPropertyChangeListener(this);
84
    }
88
    }
85
    
89
    
86
    /**
90
    /**
Lines 159-164 Link Here
159
    
163
    
160
    /** dispose all created deployment configurations */
164
    /** dispose all created deployment configurations */
161
    public void dispose() {
165
    public void dispose() {
166
        provider.removePropertyChangeListener(this);
162
        ConfigurationSupport serverConfig = server.getConfigurationSupport();
167
        ConfigurationSupport serverConfig = server.getConfigurationSupport();
163
        if (deploymentConfiguration != null && serverConfig != null) {
168
        if (deploymentConfiguration != null && serverConfig != null) {
164
            serverConfig.disposeConfiguration(deploymentConfiguration);
169
            serverConfig.disposeConfiguration(deploymentConfiguration);
Lines 472-476 Link Here
472
            collectData(server, allRelativePaths);
477
            collectData(server, allRelativePaths);
473
        }
478
        }
474
        return allRelativePaths;
479
        return allRelativePaths;
480
    }
481
482
    public void propertyChange(PropertyChangeEvent evt) {
483
        if (J2eeModuleProvider.PROP_ENTERPRISE_RESOURCE_DIRECTORY.equals(evt.getPropertyName())) {
484
            DeploymentConfiguration config = getDeploymentConfiguration();
485
            ConfigurationSupport serverConfig = server.getConfigurationSupport();
486
            Object newValue = evt.getNewValue();
487
            if (!(newValue instanceof File)) {
488
                throw new IllegalArgumentException("Enterprise resource directory property value is not a File"); // NIO18N
489
            }
490
            serverConfig.updateResourceDir(config, (File)newValue);
491
        }
475
    }
492
    }
476
}
493
}
(-)src/org/netbeans/modules/j2ee/deployment/devmodules/spi/J2eeModuleProvider.java (+45 lines)
Lines 13-18 Link Here
13
13
14
package org.netbeans.modules.j2ee.deployment.devmodules.spi;
14
package org.netbeans.modules.j2ee.deployment.devmodules.spi;
15
15
16
import java.beans.PropertyChangeListener;
17
import java.beans.PropertyChangeSupport;
16
import java.io.OutputStream;
18
import java.io.OutputStream;
17
import javax.enterprise.deploy.spi.Target;
19
import javax.enterprise.deploy.spi.Target;
18
import org.netbeans.modules.j2ee.deployment.common.api.OriginalCMPMapping;
20
import org.netbeans.modules.j2ee.deployment.common.api.OriginalCMPMapping;
Lines 48-53 Link Here
48
    List listeners = new ArrayList();
50
    List listeners = new ArrayList();
49
    private ConfigFilesListener configFilesListener = null;
51
    private ConfigFilesListener configFilesListener = null;
50
    
52
    
53
    /**
54
     * Enterprise resorce directory property
55
     *
56
     * @since 1.12
57
     */
58
    public static final String PROP_ENTERPRISE_RESOURCE_DIRECTORY = "resourceDir"; // NOI18N
59
    
60
    private PropertyChangeSupport supp = new PropertyChangeSupport(this);
61
    
51
    public J2eeModuleProvider () {
62
    public J2eeModuleProvider () {
52
        il = new IL ();
63
        il = new IL ();
53
        ServerRegistry.getInstance ().addInstanceListener (
64
        ServerRegistry.getInstance ().addInstanceListener (
Lines 103-108 Link Here
103
            return si.getStartServer().getDebugInfo(target);
114
            return si.getStartServer().getDebugInfo(target);
104
        }
115
        }
105
        return null;
116
        return null;
117
    }
118
    
119
    /**
120
     * Register a listener which will be notified when some of the properties
121
     * change.
122
     * 
123
     * @param l listener which should be added.
124
     * @since 1.12
125
     */
126
    public final void addPropertyChangeListener(PropertyChangeListener l) {
127
        supp.addPropertyChangeListener(l);
128
    }
129
    
130
    /**
131
     * Remove a listener registered previously.
132
     *
133
     * @param l listener which should be removed.
134
     * @since 1.12
135
     */
136
    public final void removePropertyChangeListener(PropertyChangeListener l) {
137
        supp.removePropertyChangeListener(l);
138
    }
139
    
140
141
    /** 
142
     * Fire PropertyChange to all registered PropertyChangeListeners.
143
     *
144
     * @param propName property name.
145
     * @param oldValue old value.
146
     * @param newValue new value.
147
     * @since 1.12
148
     */
149
    protected final void firePropertyChange(String propName, Object oldValue, Object newValue) {
150
        supp.firePropertyChange(propName, oldValue, newValue);
106
    }
151
    }
107
    
152
    
108
    /**
153
    /**
(-)src/org/netbeans/modules/j2ee/deployment/plugins/api/ConfigurationSupport.java (+10 lines)
Lines 226-229 Link Here
226
        ConfigSupportImpl conf = (ConfigSupportImpl)moduleProvider.getConfigSupport();
226
        ConfigSupportImpl conf = (ConfigSupportImpl)moduleProvider.getConfigSupport();
227
        conf.createDeploymentConfiguration(server);
227
        conf.createDeploymentConfiguration(server);
228
    }
228
    }
229
    
230
    /**
231
     * Update the enterprise resource directory for the specified deployment
232
     * configuration.
233
     *
234
     * @param config      deployment configuration
235
     * @param resourceDir new enterprise resource directory.
236
     * @since 1.12
237
     */
238
    public abstract void updateResourceDir(DeploymentConfiguration config, File resourceDir);
229
}
239
}

Return to bug 66379