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 82476
Collapse All | Expand All

(-)apichanges.xml (+18 lines)
Lines 86-91 Link Here
86
    <!-- ACTUAL CHANGES BEGIN HERE: -->
86
    <!-- ACTUAL CHANGES BEGIN HERE: -->
87
87
88
    <changes>
88
    <changes>
89
        <change id="ensureResourceDefinedUpdate">
90
            <api name="j2eeserver"/>
91
            <summary>
92
                Passing JNDI name for the resource definition callback
93
            </summary>
94
            <version major="1" minor="20"/>
95
            <date day="11" month="8" year="2006"/>
96
            <author login="lkotouc"/>
97
            <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
98
            <description>
99
                <p>
100
                    Plugin needs to know JNDI name of the resource which the resource being
101
                    defined is coming from.
102
                </p>
103
            </description>
104
            <class package="org.netbeans.modules.j2ee.deployment.devmodules.spi" name="J2eeModuleProvider"/>
105
            <class package="org.netbeans.modules.j2ee.deployment.plugins.api" name="ConfigurationSupport"/>
106
        </change>
89
        <change id="serverIcons">
107
        <change id="serverIcons">
90
            <api name="plugins"/>
108
            <api name="plugins"/>
91
            <summary>
109
            <summary>
(-)nbproject/project.properties (-1 / +1 lines)
Lines 17-23 Link Here
17
17
18
is.autoload=true
18
is.autoload=true
19
javac.source=1.5
19
javac.source=1.5
20
spec.version.base=1.19.20
20
spec.version.base=1.20.20
21
21
22
javadoc.title=J2EE Server API
22
javadoc.title=J2EE Server API
23
javadoc.overview=${basedir}/api/doc/overview.html
23
javadoc.overview=${basedir}/api/doc/overview.html
(-)src/org/netbeans/modules/j2ee/deployment/config/ConfigSupportImpl.java (-4 / +27 lines)
Lines 273-278 Link Here
273
    }
273
    }
274
    
274
    
275
    public void ensureResourceDefinedForEjb(final String ejbname, final String ejbtype) {
275
    public void ensureResourceDefinedForEjb(final String ejbname, final String ejbtype) {
276
        if (ejbname == null || ejbtype == null) {
277
            throw new NullPointerException();
278
        }
279
        DDBean ejbBean = findDDBean(ejbname, ejbtype);
280
        if (ejbBean != null) {
281
            DeploymentConfiguration config = getDeploymentConfiguration();
282
            ConfigurationSupport serverConfig = server.getConfigurationSupport();
283
            serverConfig.ensureResourceDefined(config, ejbBean);
284
        }
285
    }
286
    
287
    public void ensureResourceDefinedForEjb(String ejbname, String ejbtype, String jndiName) {
288
        if (ejbname == null || ejbtype == null || jndiName == null) {
289
            throw new NullPointerException();
290
        }
291
        DDBean ejbBean = findDDBean(ejbname, ejbtype);
292
        if (ejbBean != null) {
293
            DeploymentConfiguration config = getDeploymentConfiguration();
294
            ConfigurationSupport serverConfig = server.getConfigurationSupport();
295
            serverConfig.ensureResourceDefined(config, ejbBean, jndiName);
296
        }
297
    }
298
    
299
    private DDBean findDDBean(String ejbname, String ejbtype) {
276
        if (! J2eeModule.EJB.equals(provider.getJ2eeModule().getModuleType())) {
300
        if (! J2eeModule.EJB.equals(provider.getJ2eeModule().getModuleType())) {
277
            throw new IllegalArgumentException("Trying to get config bean for ejb on non ejb module!"); //NONI18N
301
            throw new IllegalArgumentException("Trying to get config bean for ejb on non ejb module!"); //NONI18N
278
        }
302
        }
Lines 296-306 Link Here
296
            }
320
            }
297
            Exception e = new Exception("Failed to lookup: "+ejbname+" type "+ejbtype);
321
            Exception e = new Exception("Failed to lookup: "+ejbname+" type "+ejbtype);
298
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
322
            ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
299
            return;
323
            return null;
300
        }
324
        }
301
        DeploymentConfiguration config = getDeploymentConfiguration();
325
        
302
        ConfigurationSupport serverConfig = server.getConfigurationSupport();
326
        return ejbBean;
303
        serverConfig.ensureResourceDefined(config, ejbBean);
304
    }
327
    }
305
    
328
    
306
    public Set<Datasource> getDatasources() {
329
    public Set<Datasource> getDatasources() {
(-)src/org/netbeans/modules/j2ee/deployment/devmodules/spi/J2eeModuleProvider.java (+9 lines)
Lines 330-335 Link Here
330
        public void ensureResourceDefinedForEjb(String ejbname, String ejbtype);
330
        public void ensureResourceDefinedForEjb(String ejbname, String ejbtype);
331
        
331
        
332
        /**
332
        /**
333
         * Ensure needed resources are automatically defined for the entity
334
         * represented by given DDBean.
335
         * @param ejbName the EJB name
336
         * @param ejbType the DTD name for type of EJB: 'message-drive', 'entity', 'session'.
337
         * @param jndiName the JNDI name of the resource where the EJB is stored
338
         */
339
        public void ensureResourceDefinedForEjb(String ejbName, String ejbType, String jndiName);
340
        
341
        /**
333
         * Tests whether data source creation is supported.
342
         * Tests whether data source creation is supported.
334
         *
343
         *
335
         * @return true if data source creation is supported, false otherwise.
344
         * @return true if data source creation is supported, false otherwise.
(-)src/org/netbeans/modules/j2ee/deployment/plugins/api/ConfigurationSupport.java (+12 lines)
Lines 131-136 Link Here
131
                                               DDBean bean);
131
                                               DDBean bean);
132
    
132
    
133
    /**
133
    /**
134
     * Ensure resource is defined for the specified DD bean (for example entity bean).
135
     *
136
     * @param config  deployment configuration
137
     * @param bean DD bean in question
138
     * @param jndiName the JNDI name of the resource where the bean is stored
139
     */
140
    public void ensureResourceDefined(DeploymentConfiguration config, 
141
                                               DDBean bean, String jndiName)
142
    {
143
    }
144
    
145
    /**
134
     * Return the context root (context path) defined for the module specified 
146
     * Return the context root (context path) defined for the module specified 
135
     * by the deployable object.
147
     * by the deployable object.
136
     *
148
     *

Return to bug 82476