ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Rissanen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (MUSE-227) No exceptions allowed in generated WSRF property setters/getters
Date Tue, 24 Apr 2007 12:34:15 GMT

     [ https://issues.apache.org/jira/browse/MUSE-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Erik Rissanen updated MUSE-227:
-------------------------------

    Description: 
For resource properties wsdl2java generates an interface like this (this is the sample from
the tutorial):

public interface MyCapability
{
    String PREFIX = "tns";

    String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";

    public int getMessageInterval();

    public void setMessageInterval(int param0);

    public String getServerName();

    public void setServerName(String param0);
}

Notice that the generated setters/getters do not declare any exceptions. This is fine for
the sample where the property is implemented as a simple member variable. However, if I store
the data somewhere else, for instance in a database somewhere, then getting and setting of
the actual resource data can fail with an exception.

As the interface declaration is now, I have to catch any exceptions and turn them into unchecked
RuntimeExceptions, which is a bit uggly.

Suggested fix: the interface declares either throws Exception or throws SOAPFault

  was:
For resource properties wsdl2java generates an interface like this (this is the sample from
the tutorial):

public interface MyCapability
{
    String PREFIX = "tns";

    String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";

    public int getMessageInterval();

    public void setMessageInterval(int param0);

    public String getServerName();

    public void setServerName(String param0);
}

Notice that the generated setters/getters do not declare any exceptions. This is fine for
the sample where the property is implemented as a simple member variable. However, if I store
the data somewhere else, for instance in a database somewhere, then getting and setting of
the actual resource data can fail with an exception.

As the interface declaration is now, I have to catch any exceptions and turn them into unchecked
RuntimeExceptions, which is a bit uggly.

Suggested workaround: the interface declares either throws Exception or throws SOAPFault


Corrected typo in description

> No exceptions allowed in generated WSRF property setters/getters
> ----------------------------------------------------------------
>
>                 Key: MUSE-227
>                 URL: https://issues.apache.org/jira/browse/MUSE-227
>             Project: Muse
>          Issue Type: Bug
>          Components: Tooling - Code Generation
>    Affects Versions: 2.3.0
>         Environment: Linux. Muse nightly build 2.3.0-2007-04-16-02-00
>            Reporter: Erik Rissanen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>
> For resource properties wsdl2java generates an interface like this (this is the sample
from the tutorial):
> public interface MyCapability
> {
>     String PREFIX = "tns";
>     String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";
>     public int getMessageInterval();
>     public void setMessageInterval(int param0);
>     public String getServerName();
>     public void setServerName(String param0);
> }
> Notice that the generated setters/getters do not declare any exceptions. This is fine
for the sample where the property is implemented as a simple member variable. However, if
I store the data somewhere else, for instance in a database somewhere, then getting and setting
of the actual resource data can fail with an exception.
> As the interface declaration is now, I have to catch any exceptions and turn them into
unchecked RuntimeExceptions, which is a bit uggly.
> Suggested fix: the interface declares either throws Exception or throws SOAPFault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


Mime
View raw message