Lines 13-35
Link Here
|
13 |
* "Portions Copyrighted [year] [name of copyright owner]" |
13 |
* "Portions Copyrighted [year] [name of copyright owner]" |
14 |
* |
14 |
* |
15 |
* The Original Software is NetBeans. The Initial Developer of the Original |
15 |
* The Original Software is NetBeans. The Initial Developer of the Original |
16 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun |
16 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun |
17 |
* Microsystems, Inc. All Rights Reserved. |
17 |
* Microsystems, Inc. All Rights Reserved. |
18 |
*/ |
18 |
*/ |
19 |
|
19 |
|
20 |
package org.netbeans.modules.j2ee.deployment.devmodules.spi; |
20 |
package org.netbeans.modules.j2ee.deployment.devmodules.spi; |
21 |
|
21 |
|
22 |
import java.beans.PropertyChangeListener; |
|
|
23 |
import java.beans.PropertyChangeSupport; |
24 |
import java.io.IOException; |
25 |
import java.io.OutputStream; |
22 |
import java.io.OutputStream; |
26 |
import java.util.Collections; |
23 |
import java.util.Collections; |
27 |
import java.util.Iterator; |
24 |
import java.util.Iterator; |
28 |
import java.util.Map; |
|
|
29 |
import java.util.Set; |
25 |
import java.util.Set; |
30 |
import javax.enterprise.deploy.spi.Target; |
26 |
import javax.enterprise.deploy.spi.Target; |
31 |
import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException; |
27 |
import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException; |
32 |
import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException; |
|
|
33 |
import org.netbeans.modules.j2ee.deployment.common.api.OriginalCMPMapping; |
28 |
import org.netbeans.modules.j2ee.deployment.common.api.OriginalCMPMapping; |
34 |
import org.netbeans.modules.j2ee.deployment.common.api.ValidationException; |
29 |
import org.netbeans.modules.j2ee.deployment.common.api.ValidationException; |
35 |
import org.netbeans.modules.j2ee.deployment.config.*; |
30 |
import org.netbeans.modules.j2ee.deployment.config.*; |
Lines 38-44
Link Here
|
38 |
import org.netbeans.modules.j2ee.deployment.impl.Server; |
33 |
import org.netbeans.modules.j2ee.deployment.impl.Server; |
39 |
import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; |
34 |
import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; |
40 |
import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; |
35 |
import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; |
41 |
import org.netbeans.modules.j2ee.deployment.impl.ServerString; |
|
|
42 |
import org.netbeans.modules.j2ee.deployment.impl.ServerTarget; |
36 |
import org.netbeans.modules.j2ee.deployment.impl.ServerTarget; |
43 |
import org.netbeans.modules.j2ee.deployment.common.api.Datasource; |
37 |
import org.netbeans.modules.j2ee.deployment.common.api.Datasource; |
44 |
import org.netbeans.modules.j2ee.deployment.common.api.DatasourceAlreadyExistsException; |
38 |
import org.netbeans.modules.j2ee.deployment.common.api.DatasourceAlreadyExistsException; |
Lines 49-59
Link Here
|
49 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.VerifierSupport; |
43 |
import org.netbeans.modules.j2ee.deployment.plugins.spi.VerifierSupport; |
50 |
import org.openide.ErrorManager; |
44 |
import org.openide.ErrorManager; |
51 |
import org.openide.filesystems.FileObject; |
45 |
import org.openide.filesystems.FileObject; |
52 |
import org.openide.filesystems.FileUtil; |
|
|
53 |
import org.openide.util.WeakListeners; |
54 |
import java.io.File; |
55 |
import java.util.ArrayList; |
46 |
import java.util.ArrayList; |
56 |
import java.util.List; |
47 |
import java.util.List; |
|
|
48 |
import org.netbeans.modules.j2ee.deployment.common.api.MessageDestination; |
57 |
|
49 |
|
58 |
/** This object must be implemented by J2EE module support and an instance |
50 |
/** This object must be implemented by J2EE module support and an instance |
59 |
* added into project lookup. |
51 |
* added into project lookup. |
Lines 207-213
Link Here
|
207 |
try { |
199 |
try { |
208 |
//btw, ds existence in a project is verified directly in the deployment configuration |
200 |
//btw, ds existence in a project is verified directly in the deployment configuration |
209 |
ds = getConfigSupport().createDatasource(jndiName, url, username, password, driver); |
201 |
ds = getConfigSupport().createDatasource(jndiName, url, username, password, driver); |
210 |
} catch (OperationUnsupportedException oue) { |
202 |
} catch (UnsupportedOperationException oue) { |
211 |
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, oue); |
203 |
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, oue); |
212 |
} |
204 |
} |
213 |
|
205 |
|
Lines 325-337
Link Here
|
325 |
* @param password user's password |
317 |
* @param password user's password |
326 |
* @param driver fully qualified name of database driver class |
318 |
* @param driver fully qualified name of database driver class |
327 |
* @return created data source |
319 |
* @return created data source |
328 |
* @exception OperationUnsupportedException if operation is not supported |
320 |
* @exception UnsupportedOperationException if operation is not supported |
329 |
* @exception DatasourceAlreadyExistsException if conflicting data source is found |
321 |
* @exception DatasourceAlreadyExistsException if conflicting data source is found |
330 |
* |
322 |
* |
331 |
* @since 1.15 |
323 |
* @since 1.15 |
332 |
*/ |
324 |
*/ |
333 |
public Datasource createDatasource(String jndiName, String url, String username, String password, String driver) |
325 |
public Datasource createDatasource(String jndiName, String url, String username, String password, String driver) |
334 |
throws OperationUnsupportedException, DatasourceAlreadyExistsException, ConfigurationException; |
326 |
throws UnsupportedOperationException, DatasourceAlreadyExistsException, ConfigurationException; |
|
|
327 |
|
328 |
/** |
329 |
* Binds the data source name used in the sources with the corresponding data source which is |
330 |
* identified the given JNDI name. |
331 |
* |
332 |
* @param referenceName name used to identify the data source |
333 |
* @param jndiName JNDI name of the data source |
334 |
* @throws ConfigurationException if there is some problem with data source configuration |
335 |
* |
336 |
* @since 1.25 |
337 |
*/ |
338 |
public void bindDatasourceReference(String dsReferenceName, String dsJNDIName) throws ConfigurationException; |
339 |
|
340 |
/** |
341 |
* Binds the data source name used in the sources with the corresponding data source which is |
342 |
* identified the given JNDI name. The reference is used within the scope of the EJB. |
343 |
* |
344 |
* @param referenceName name used to identify the data source |
345 |
* @param jndiName JNDI name of the data source |
346 |
* @param ejbName EJB name |
347 |
* @param ejbType EJB type - the possible values are |
348 |
* org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.SESSION, |
349 |
* org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.ENTITY and |
350 |
* org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.MESSAGE_DRIVEN |
351 |
|
352 |
* @throws ConfigurationException if there is some problem with data source configuration |
353 |
* @throws IllegalArgumentException if ejbType doesn't have one of allowed values |
354 |
* |
355 |
* @since 1.25 |
356 |
*/ |
357 |
public void bindDatasourceReferenceEjb(String dsReferenceName, String dsJNDIName, |
358 |
String ejbName, String ejbType) throws ConfigurationException; |
359 |
|
360 |
/** |
361 |
* Finds data source which is mapped to the given reference name. |
362 |
* |
363 |
* @referenceName reference name |
364 |
* @return data source if it exists, null otherwise |
365 |
* |
366 |
* @throws ConfigurationException if there is some problem with data source configuration |
367 |
* |
368 |
* @since 1.25 |
369 |
*/ |
370 |
public Datasource findDatasourceForReference(String referenceName) throws ConfigurationException; |
371 |
|
372 |
/** |
373 |
* Finds data source which is mapped to the given reference name in the scope the EJB. |
374 |
* |
375 |
* @param referenceName reference name |
376 |
* @param ejbName EJB name |
377 |
* @return data source if it exists, null otherwise |
378 |
* |
379 |
* @throws ConfigurationException if there is some problem with data source configuration |
380 |
* |
381 |
* @since 1.25 |
382 |
*/ |
383 |
public Datasource findDatasourceForReferenceEjb(String referenceName, String ejbName) throws ConfigurationException; |
384 |
|
385 |
/** |
386 |
* Retrieves message destinations stored in the module. |
387 |
* |
388 |
* @return set of message destinations |
389 |
* |
390 |
* @throws ConfigurationException if there is some problem with message destination configuration |
391 |
* |
392 |
* @since 1.25 |
393 |
*/ |
394 |
public Set<MessageDestination> getMessageDestinations() throws ConfigurationException; |
395 |
|
396 |
/** |
397 |
* Retrieves message destinations configured on the target server instance. |
398 |
* |
399 |
* @return set of message destinations |
400 |
* |
401 |
* @throws ConfigurationException if there is some problem with message destination configuration |
402 |
* |
403 |
* @since 1.25 |
404 |
*/ |
405 |
public Set<MessageDestination> getServerMessageDestinations() throws ConfigurationException; |
406 |
|
407 |
/** |
408 |
* Tests whether a message destination creation is supported. |
409 |
* |
410 |
* @return true if message destination creation is supported, false otherwise. |
411 |
* |
412 |
* @since 1.25 |
413 |
*/ |
414 |
public boolean supportsCreateMessageDestination(); |
415 |
|
416 |
/** |
417 |
* Creates and saves a message destination in the module if it does not exist in the module yet. |
418 |
* Message destinations are considered to be equal if their JNDI names are equal. |
419 |
* |
420 |
* @param jndiName JNDI name of the message destination |
421 |
* @param type message destination type; the value is of |
422 |
* org.netbeans.modules.j2ee.deployment.common.api.MessageDestination.Type type |
423 |
* @return created message destination |
424 |
* |
425 |
* @throws UnsupportedOperationException if this opearation is not supported |
426 |
* @throws ConfigurationException if there is some problem with message destination configuration |
427 |
* |
428 |
* @since 1.25 |
429 |
*/ |
430 |
public MessageDestination createMessageDestination(String jndiName, MessageDestination.Type type) |
431 |
throws UnsupportedOperationException, ConfigurationException; |
335 |
} |
432 |
} |
336 |
|
433 |
|
337 |
/** |
434 |
/** |