|
Extension SDK 9.0.5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jdeveloper.webservices.JAXRPCSvcModel
This class represents common parts of the data model used behind all types of JAX-RPC web service. It contains only fields related to the web service name and type, and the way it is deployed. Being the base class of all web service data models, this class also handles the pseudo-transaction mechanism and listener notifications, both of which are important for external clients. Properties All properties relevant to a web service must have JavaBean getter and setter methods. This is to allow them to be persisted by the Object2Dom marshalling framework, as well as for allowing access to clients. If you are writing your own model, and the setter method for a property should never be called other than by Object2Dom, mark the method as for persistence only in the JavaDoc. If the property doesn't need to be persisted, make sure that its getter method throws the oracle.ide.util.TransientMarker exception. It is also recommended that all properties are private to the class, such that subclasses must also access their values through the accessors. Validation The properties of a model can be validated all at one, or in subsets. Each model defines a set of String identifiers that refer to the properties on that model that can be validated. Passing in an array of those strings should cause only those properties to be validated; if the array is null or empty, all properties should be validated. If you are writing your own model, ensure that the first thing it does is call the validate method on its superclass, in order to ensure that any common properties are also validated. Pseudo-transaction mechanism Before editing a web service model, clients must call beginEdit. Property values can still be changed without calling beginEdit, but neither undoEdit nor saveEdit will be available, meaning that changes cannot be persisted. As the names suggest, undoEdit will undo any changes made to the model since the last beginEdit, and saveEdit will save the changes and initiate regeneration of the artifacts for that web service. It's also worth noting that beginEdit calls can't be nested. Calling beginEdit for a second time will have no effect. If you are writing your own web service model, you should override the beginEdit, saveEditInternal and undoEdit methods to include backup of the additional properties that they define, and initiate generation of artifacts if the user has saved their changes. Invoking wizards All web service models have an associated wizard that allows the user to edit them. This wizard can be invoked by calling invokeWizard. This will first invoke beginEdit if that hasn't already been done, and then will perform a saveEdit or undoEdit, depending on whether the user exits the wizard via the OK button or the Cancel button. If you are writing your own model, you should supply an implementation of invokeWizardInternal that directly or indirectly places panels onto the base wizard supplied, and uses that wizard. Listeners Listeners will be notified any time that a model is updated or removed. The mechanism follows the standard listener pattern used in Java. Listeners must implement the WebServiceModelListener interface.
Field Summary | |
static java.lang.String |
ALL_WRITEABLE
Property identifier. |
static java.lang.String |
ENDPOINT
Property identifier. |
protected JAXRPCSvcModel |
m_backup
We internally have a space for a backup copy of the model, for use when we need to restore the model's previous state after the user presses cancel in a wizard. |
protected boolean |
m_modelRenameRequired
A flag that indicates whether the persisted web service file is from a migrated project, and thus has a different filename convention to the ones in 9.0.5. |
protected JProject |
m_targetProject
The project that the service should belong to. |
static int |
PLATFORM_ALL_SERVERS
Service platform constant. |
static int |
PLATFORM_APACHE_2X
Service platform constant. |
static int |
PLATFORM_JAX_RPC
Service platform constant. |
static int |
PLATFORM_ORACLE_IAS_20
Service platform constant. |
static int |
PLATFORM_ORACLE_J2EE
Service platform constant. |
static java.lang.String |
TARGET_NAMESPACE
Property identifier. |
static int |
TYPE_JAVA
Web service type constant. |
static int |
TYPE_JMS
Web service type constant. |
static int |
TYPE_PLSQL
Web service type constant. |
static int |
TYPE_UNKNOWN
Web service type constant. |
static java.lang.String |
URI
Property identifier. |
static java.lang.String |
WEB_XML_URL
Property identifier. |
static java.lang.String |
WSDL_URL
Property identifier. |
Constructor Summary | |
JAXRPCSvcModel()
Default constructor. |
|
JAXRPCSvcModel(boolean migratedService)
Create a new web service model, allowing the creator to specify that it is being created to hold data being migrated from an older version of JDeveloper. |
|
JAXRPCSvcModel(java.net.URI uri)
Create a new web service with the supplied URI. |
Method Summary | |
void |
addModelListener(WebServiceModelListener listener)
Add a new listener to the model. |
void |
beginEdit()
Make a copy of this model and store it internally, ready for updates that can be applied or undone. |
java.net.URL |
deriveSoapDDFileLocation()
Derive a default value for the Oracle/Apache SOAP deployment descriptor file location. |
abstract java.net.URI |
deriveTargetNamespace()
Derive a model-specific default target namespace URI for the service. |
abstract java.net.URL |
deriveWSDLFileLocation()
Derive a location for a WSDL file for this service. |
Node[] |
generateWar()
Generate a WAR deployment profile for the service. |
oracle.jdevimpl.webservices.ide.WebServicesContainer |
getContainer()
Get the WebServicesContainer that represents this service in the navigator. |
java.net.URL |
getDefaultEndpointFromAppServer(java.lang.String appServer)
Derive an endpoint for a J2EE or JAX-RPC service, based on the supplied application server connection name. |
java.lang.String[] |
getDependents()
Get the stubs and skeletons which have a dependency on this web service. |
java.net.URL |
getEndpoint()
|
java.lang.String |
getGUID()
|
java.lang.String |
getHostName()
Attempt to resolve the machine's hostname, if we get a failure return localhost string. |
java.lang.String |
getJNDILocation()
|
MethodSignature[] |
getMethodsFromWSDL()
Look at the WSDL for the service and return a list of method signatures corresponding to the operations found. |
abstract java.net.URL |
getModelLocation()
Determine what the location of the persisted model will be after generation. |
JAXRPCSvcModel |
getPreviousState()
|
int |
getServicePlatform()
|
java.net.URL |
getSoapDDFileLocation()
Determine the location of the SOAP deployment descriptor file for the web service that will be produced by this model. |
abstract URLPath |
getTargetDirectories()
Work out all of the directories that will be touched by the JAX-RPC assembler in creating the service. |
java.net.URI |
getTargetNamespace()
|
java.lang.String |
getTargetNamespaceString()
Convert a targetNamespace URI into a string, for use by Object2Dom. |
JProject |
getTargetProject()
|
java.net.URL |
getTargetProjectURL()
We store the URL of the target project, rather than the full project itself. |
abstract int |
getType()
|
java.net.URI |
getURI()
|
java.lang.String |
getURIString()
Convert a URI into a string, for use by Object2Dom. |
java.net.URL |
getWebXMLFileLocation()
Determine the location of the web.xml file in the current target project. |
java.net.URL |
getWSDLFileLocation()
Determine the WSDL file location for the web service that will be produced by this model. |
boolean |
invokeWizard(boolean showProgressBar,
boolean openFiles,
java.awt.Component dialogParent)
Invoke a wizard to edit this data model. |
protected abstract boolean |
invokeWizardInternal(oracle.bali.ewt.wizard.BaseWizard wizard,
boolean showProgressBar,
boolean openFiles,
java.awt.Component dialogParent)
Invoke a wizard to edit this data model. |
boolean |
isBeingEdited()
|
boolean |
isNewModel()
Determine whether or not the model supplied is new or has already gone through a beginEdit-saveEdit cycle. |
boolean |
isReadOnly()
The default implementation of this method returns false, indicating that the model is read-write. |
boolean |
isServicePlatformEditable()
|
boolean |
isWarGenerationSuppressed()
|
void |
remove(java.awt.Component dialogParent)
Deprecated. Replaced by remove(Component dialogParent, boolean destroy) |
void |
remove(java.awt.Component dialogParent,
boolean destroy)
Remove the service from JDeveloper. |
void |
removeModelListener(WebServiceModelListener listener)
Remove a listener from the model's listener list. |
void |
saveEdit(boolean validate,
boolean showProgressBar,
boolean openFiles,
java.awt.Component dialogParent)
Generate the service. |
protected void |
saveEditInternal()
Discard the backup copy of the model. |
void |
setEndpoint(java.net.URL endpoint)
|
void |
setGUID(java.lang.String guid)
|
void |
setJNDILocation(java.lang.String jndiLocation)
|
void |
setServicePlatform(int servicePlatform)
|
void |
setServicePlatformEditable(boolean servicePlatformEditable)
|
void |
setTargetNamespace(java.net.URI targetNamespace)
|
void |
setTargetNamespaceString(java.lang.String targetNamespace)
Convert a string into a targetNamespace URI, for use by Object2Dom. |
void |
setTargetProject(JProject targetProject)
|
void |
setTargetProjectURL(java.net.URL targetProject)
We look for the target project at the URL provided. |
void |
setURI(java.net.URI uri)
|
void |
setURIString(java.lang.String uri)
Convert a string into a URI, for use by Object2Dom. |
void |
startEmbeddedServer()
Start this web service in the embedded OC4J server. |
void |
suppressWarGeneration()
Suppress generation of a WAR deployment profile the next time that saveEdit is invoked. |
void |
terminateEmbeddedServer()
If it is running, terminate the embedded OC4J server running this web service. |
protected java.lang.String |
trim(java.lang.String str)
Null-safe method that will trim whitespace from strings. |
void |
undoEdit()
Restore the state of the model to what it was when beginEdit was called. |
void |
validate(java.lang.String[] properties)
Validate all of the properties whose identifiers have been supplied in the String array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ENDPOINT
public static final java.lang.String TARGET_NAMESPACE
public static final java.lang.String URI
public static final java.lang.String WSDL_URL
public static final java.lang.String WEB_XML_URL
public static final java.lang.String ALL_WRITEABLE
public static final int PLATFORM_ALL_SERVERS
public static final int PLATFORM_ORACLE_IAS_20
public static final int PLATFORM_APACHE_2X
public static final int PLATFORM_ORACLE_J2EE
public static final int PLATFORM_JAX_RPC
public static final int TYPE_UNKNOWN
public static final int TYPE_JAVA
public static final int TYPE_PLSQL
public static final int TYPE_JMS
protected JAXRPCSvcModel m_backup
protected JProject m_targetProject
protected boolean m_modelRenameRequired
Constructor Detail |
public JAXRPCSvcModel()
public JAXRPCSvcModel(java.net.URI uri)
uri
- URI to give to the new service.public JAXRPCSvcModel(boolean migratedService)
migratedService
- Set this to true to indicate that the model will
contain data being migrated from an older version of JDeveloper.Method Detail |
public void setGUID(java.lang.String guid)
guid
- Unique identifier for this web service.public java.lang.String getGUID()
public void setTargetNamespace(java.net.URI targetNamespace)
targetNamespace
- The target namespace to be used in the service's
WSDL.public java.net.URI getTargetNamespace() throws TransientMarker
TransientMarker
public abstract java.net.URI deriveTargetNamespace()
public void setTargetNamespaceString(java.lang.String targetNamespace)
public java.lang.String getTargetNamespaceString()
public void setURI(java.net.URI uri)
uri
- URI (name) of the web service.public java.net.URI getURI() throws TransientMarker
TransientMarker
public void setURIString(java.lang.String uri)
public java.lang.String getURIString()
public void setTargetProject(JProject targetProject)
targetProject
- The project that the service should belong to.public JProject getTargetProject() throws TransientMarker
TransientMarker
public void setTargetProjectURL(java.net.URL targetProject)
public java.net.URL getTargetProjectURL()
public void setServicePlatform(int servicePlatform)
servicePlatform
- The platform this service is intended to operate
on. See the PLATFORM_ constants at the top of this class.public int getServicePlatform()
public void setServicePlatformEditable(boolean servicePlatformEditable)
servicePlatformEditable
- Boolean flag, indicating whether the
service platform can be altered from a wizard.public boolean isServicePlatformEditable()
public java.net.URL getWSDLFileLocation()
public abstract java.net.URL deriveWSDLFileLocation()
public java.net.URL getEndpoint()
public void setEndpoint(java.net.URL endpoint)
endpoint
- The endpoint at which the service is available.public java.net.URL getDefaultEndpointFromAppServer(java.lang.String appServer)
appServer
- Name of the application server connection.
public java.lang.String getJNDILocation()
public void setJNDILocation(java.lang.String jndiLocation)
jndiLocation
- The JNDI location of a database resource associated
with this service.public java.net.URL getSoapDDFileLocation()
public java.net.URL deriveSoapDDFileLocation()
public java.net.URL getWebXMLFileLocation()
public boolean isNewModel()
public boolean isReadOnly()
public abstract URLPath getTargetDirectories()
public abstract java.net.URL getModelLocation()
public abstract int getType()
public MethodSignature[] getMethodsFromWSDL()
public oracle.jdevimpl.webservices.ide.WebServicesContainer getContainer()
public java.lang.String[] getDependents()
public void addModelListener(WebServiceModelListener listener)
listener
- New listener to add.public void removeModelListener(WebServiceModelListener listener)
listener
- Listener to remove.public boolean isBeingEdited()
public void suppressWarGeneration()
public boolean isWarGenerationSuppressed()
public void beginEdit()
java.lang.IllegalStateException
- if the model is read-only.protected void saveEditInternal()
public JAXRPCSvcModel getPreviousState() throws TransientMarker
TransientMarker
public void undoEdit()
java.lang.IllegalStateException
- if an edit was never started.public void validate(java.lang.String[] properties) throws java.lang.Exception
properties
- Array of string identifiers of all the properties that
should be validated. If the array is null or empty, all properties
will be validated.
java.lang.Exception
- containing a translated message that explains why
validation failed.public final void saveEdit(boolean validate, boolean showProgressBar, boolean openFiles, java.awt.Component dialogParent) throws java.lang.Exception
validate
- Boolean flag, set this to true if the model should be
validated before generation takes place.showProgressBar
- Boolean flag, set this to true if a progress bar
should be shown during generation.openFiles
- Boolean flag, set this to true if generated files should
be opened after generation.dialogParent
- Parent component for any progress or error dialogs
displayed during generation.
java.lang.Exception
- containing an explanation message if validation was
selected and a validation error occurred.
java.lang.IllegalStateException
- if the model was not being edited.public Node[] generateWar() throws java.io.IOException
java.io.IOException
- if generation of the WAR profile failed.public final boolean invokeWizard(boolean showProgressBar, boolean openFiles, java.awt.Component dialogParent)
showProgressBar
- Boolean flag, set this to true if a progress bar
should be shown during generation.openFiles
- Boolean flag, set this to true if generated files should
be opened after generation.dialogParent
- Parent component for any progress or error dialogs
displayed during generation.
protected abstract boolean invokeWizardInternal(oracle.bali.ewt.wizard.BaseWizard wizard, boolean showProgressBar, boolean openFiles, java.awt.Component dialogParent)
wizard
- Wizard class that pages and panels should be added to.showProgressBar
- Boolean flag, set this to true if a progress bar
should be shown during generation.openFiles
- Boolean flag, set this to true if generated files should
be opened after generation.dialogParent
- Parent component for any progress or error dialogs
displayed during generation.
public void remove(java.awt.Component dialogParent, boolean destroy) throws java.lang.Exception
dialogParent
- Parent component for any error dialogs displayed
during removal.destroy
- Determines whether the files associated with this model
will be removed from the disk. Value true will delete from the disk.
java.lang.Exception
public void remove(java.awt.Component dialogParent) throws java.lang.Exception
dialogParent
- Parent component for any error dialogs displayed
during removal.
java.lang.Exception
public void startEmbeddedServer() throws java.lang.Exception
java.lang.IllegalStateException
- if the service hasn't been generate yet.
java.lang.Exception
public void terminateEmbeddedServer() throws java.lang.Exception
java.lang.Exception
protected java.lang.String trim(java.lang.String str)
str
- String to trim, doesn't matter if it is null.
public java.lang.String getHostName()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.