Do Utility classes also have a delegate to call them?
My application is a J2EE application�.and we are using delegates to call the Business objects which in turn call the DAO�s. (Struts framework)
This is the pattern for business calls.
Now my question is�. If we have some common utility classes� then is there any pattern for using those classes also?
Like should we be creating a business delegate for the common utility classes like logging or so?
These classes are placed in the common util folder of our application.
You don't use patterns because they exist - you use them because you need the functionality.
If you think that swapping out logging is likely to happen then you need to wrap it. Jakarta commons already has a layer for that.
If you don't think that is likely to happen then don't wrap it.
Similar Messages
-
Phone died when on with a Customer Service agent. Now both phones are dead...What do I do now? Trying to set up my iphone 4S and I have no phone to call them back.
I was told I can set up my phone service through iTunes, but I can't seem to figure out where to go at this point. Any help would be greatly appreciated!
Gregwhat do you mean, it died? plug it into the power! :-)
-
Does WLS check if the JSP .class files have been modified?
When I precompile the JSPs from the command line with weblogic.jspc while WLS is running,
does WLS check to see if the .class files have been updated and reload them?
BEA Support says 5.1 SP8 does (case 198104).
I thought I read an 'Issue' saying it did (9841?) - I can't find it now.
It does not appear to.
Mike
It was this issue - 9341 - the description is kinda vague
http://www.weblogic.com/docs51/classdocs/README2.html#9341
Mike
"[email protected]" <[email protected]> wrote:
>
>When I precompile the JSPs from the command line with weblogic.jspc while WLS is running,
>does WLS check to see if the .class files have been updated and reload them?
>
>BEA Support says 5.1 SP8 does (case 198104).
>
>I thought I read an 'Issue' saying it did (9841?) - I can't find it now.
>
>It does not appear to.
>
>Mike
-
I recently (Jan 2012) acquired a MacBook Pro (MBP) running 10.7.4 and an AirPort Express. I also have an old PPC G4 tower (Digital Audio model) running 10.4.11. The OS software on both machines is totally up to date. AirPort Utility on the G4 is 5.4.2 and on 6.0 on the MBP. I bought a used AirPort card for the G4, I believe it is 802.11b compatible, and the wireless data rate is specified at 11 Mbps. Being a newbie to wireless, it took me many days to get these two machines to link up. This network is not connected to the internet, and there no other networks in the vicinity.
My last problem to solve is the very slow file transfer speeds between the two machines. The transfer time seems to vary depending on which machine I use to initiate the transfer, and which direction the transfer is going. For example: If I initiate the transfer from the G4 and send a 5.4MB file to the MBP it takes 1:32 (min:sec), while the same file going from the MBP to the G4 takes 27 seconds. On the other hand if the transfer is initiated on the MBP, going from the MBP to the G4 takes 2:56, while going from the G4 to the MBP takes 1:59. I realize that these times are not actual wireless transfer times but includes the entire transfer process.
Both machines and the AirPort Express are within a 4-foot radius. Both machines are set to radio channel 2. The AirPort Express is set for 802.11n(802.11b/g compatible) with WPA/WPA2 Personal wireless security.
Any help would be appreciated.
CEU2BDAqua,
Thanks for the response.
Apple has used the term "Digital Audio" to identify this machine. System Profiler has the following information:
Machine Name: Power Mac G4
Machine Model: PowerMac3,5
CPU Type: PowerPC G4 (2.1)
Number Of CPUs: 1
CPU Speed: 800 MHz
L2 Cache (per CPU): 256 KB
Memory: 768 MB
Bus Speed: 133 MHz
Boot ROM Version: 4.3.3f2
Serial Number: XBxxxxxMK9
Sales Order Number:
Yes, I could connect them by ethernet if all I wanted to do was transfer files, but I would like to network them so I could use wireless internet. The machines are not always so close together, I did that to simplify the testing. With the very slow transfer speeds I am reluctant to move ahead with the internet step.
<Edited By Host> -
JavaDocError: Utility classes should not have a public or default construct
Hello all,
I am trying to comply with some check style errors that i am getting and i cannot seem to figure out what is going on. I have set all non-data members to private, except for call point public static void main(string[] args) and i am still getting this error. "Utility classes should not have a public or default constructor." I cannot figure out what is going on, any help would be greatly welcomed. My code is posted below.
public final class Main
* Constant Data Member: RECTANGLE
* Purpose: contains the constant string representing a rectangle.
* @deprecated RECTANGLE Representitive string value for a rectangle.
public static final String RECTANGLE = "rectangle";
* Constant Data Member: TRIANGLE
* Purpose: contains the constant string representing a triangle.
* @deprecated TRIANGLE Representitive string value for a triangle.
public static final String TRIANGLE = "triangle";
* Constant Data Member: REGEX_NUMBER_TEST
* Purpose: contains the constant for numerical test within regex method.
* @deprecated REGEX_NUMBER_TEST regex string for digit comparison.
public static final String REGEX_NUMBER_TEST = "^[0-9]+$";
* Constant Data Member: MAX_ARGUMENTS_RECTANGLE
* Purpose: contains the constant for the maximum number of allowed
* arguments coming in from the command line.
* @deprecated MAX_ARGUMENTS_RECTANGLE constant for rectangle argument.
* limit.
public static final int MAX_ARGUMENTS_RECTANGLE = 3;
* Constant Data Member: MAX_ARGUMENTS_TRIANGLE
* Purpose: contains the constant for the maximum number of allowed
* arguments coming in from the command line, in the case of a
* triangle object.
* @deprecated MAX_ARGUMENTS_TRIANGLE constant for triangle argument limit.
public static final int MAX_ARGUMENTS_TRIANGLE = 2;
* Method: main
* Purpose: Is the execution point for the program. It is in charge of
* initiating validation and the creation and application of
* objects and their related draw methods.
* @param args input from the user.
public static void main(final String[] args)
String objectType = null;
int width = 0;
int height = 0;
if(args.length > MAX_ARGUMENTS_RECTANGLE || args.length <
MAX_ARGUMENTS_TRIANGLE || (args.length == MAX_ARGUMENTS_TRIANGLE &&
!isTriangle(args[0])))
// fails
outputErrorMessage();
else
if ((isTriangle(args[0]) && args.length > MAX_ARGUMENTS_TRIANGLE) ||
(!isTriangle(args[0]) && args.length > MAX_ARGUMENTS_RECTANGLE))
// fails becuase triangle should only have one argument
outputErrorMessage();
else
// passes and proceed
objectType = args[0];
if (validNumber(args[1]))
width = Integer.parseInt(args[1]);
if(width == 0)
outputErrorMessage();
else
....Add a private constructor.
private Main() { }
...This way it will be not possible to create an instance because it is not needed to use its static members or methods.
ref : [http://www.javapractices.com/topic/TopicAction.do?Id=40]
Bye. -
Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected]Namburi,
When you said you used the Reg Exp tool, did you use it only as
preconfigured by the iMT migrate application wizard?
Because the default configuration of the regular expression tool will only
target the files in your ND project directories. If you wish to target
classes outside of the normal directory scope, you have to either modify the
"Source Directory" property OR create another instance of the regular
expression tool. See the "Tool" menu in the iMT to create additional tool
instances which can each be configured to target different sets of files
using different sets of rules.
Usually, I utilize 3 different sets of rules files on a given migration:
spider2jato.xml
these are the generic conversion rules (but includes the optimized rules for
ViewBean and Model based code, i.e. these rules do not utilize the
RequestManager since it is not needed for code running inside the ViewBean
or Model classes)
I run these rules against all files.
See the file download section of this forum for periodic updates to these
rules.
nonProjectFileRules.xml
these include rules that add the necessary
RequestManager.getRequestContext(). etc prefixes to many of the common
calls.
I run these rules against user module and any other classes that do not are
not ModuleServlet, ContainerView, or Model classes.
appXRules.xml
these rules include application specific changes that I discover while
working on the project. A common thing here is changing import statements
(since the migration tool moves ND project code into different jato
packaging structure, you sometime need to adjust imports in non-project
classes that previously imported ND project specific packages)
So you see, you are not limited to one set of rules at all. Just be careful
to keep track of your backups (the regexp tool provides several options in
its Expert Properties related to back up strategies).
----- Original Message -----
From: <vnamboori@y...>
Sent: Wednesday, August 08, 2001 6:08 AM
Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
forget about the regular expression potential
Thanks Matt, Mike, Todd
This is a great input for our migration. Though we used the existing
Regular Expression Mapping tool, we did not change this to meet our
own needs as mentioned by Mike.
We would certainly incorporate this to ease our migration.
Namburi
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
All--
Great response. By the way, the Regular Expression Tool uses thePerl5 RE
syntax as implemented by Apache OROMatcher. If you're doing lotsof these
sorts of migration changes manually, you should definitely buy theO'Reilly
book "Mastering Regular Expressions" and generate some rules toautomate the
conversion. Although they are definitely confusing at first,regular
expressions are fairly easy to understand with some documentation,and are
superbly effective at tackling this kind of migration task.
Todd
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@S...>
Sent: Tuesday, August 07, 2001 5:20 PM
Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
forget about the regular expression potential
Also, (and Matt's document may mention this)
Please bear in mind that this statement is not totally correct:
Since the migration tool does not do much of conversion for
these
utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
the translation tool, and the regular expression tool, and severalother
smaller tools (like the jar and compilation tools). It is correctto state
that the extraction and translation tools only significantlyconvert the
primary ND project objects (the pages, the data objects, and theproject
classes). The extraction and translation tools do minimumtranslation of the
User Module objects (i.e. they repackage the user module classes inthe new
jato module packages). It is correct that for all other utilityclasses
which are not formally part of the ND project, the extraction and
translation tools do not perform any migration.
However, the regular expression tool can "migrate" any arbitrary
file
(utility classes etc) to the degree that the regular expressionrules
correlate to the code present in the arbitrary file. So first andforemost,
if you have alot of spider code in your non-project classes youshould
consider using the regular expression tool and if warranted adding
additional rules to reduce the amount of manual adjustments thatneed to be
made. I can stress this enough. We can even help you write theregular
expression rules if you simply identify the code pattern you wish to
convert. Just because there is not already a regular expressionrule to
match your need does not mean it can't be written. We have notnearly
exhausted the possibilities.
For example if you say, we need to convert
CSpider.getDataObject("X");
To
RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
rule:
<!--getPage to getViewBean-->
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getViewBean($1ViewBean.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
Following this example a getDataObject to getModel would look
like this:
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[getModel($1Model.class]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
In fact, one migration developer already wrote that rule andsubmitted it
for inclusion in the basic set. I will post another upgrade to thebasic
regular expression rule set, look for a "file uploaded" posting.Also,
please consider contributing any additional generic rules that youhave
written for inclusion in the basic set.
Please not, that in some cases (Utility classes in particular)
the rule
application may be more effective as TWO sequention rules ratherthan one
monolithic rule. Again using the example above, it will convert
CSpider.getDataObject("Foo");
To
getModel(FooModel.class);
Now that is the most effective conversion for that code if that
code is in
a page or data object class file. But if that code is in a Utilityclass you
really want:
>
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
So to go from
getModel(FooModel.class);
To
RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
You would apply a second rule AND you would ONLY run this rule
against
your utility classes so that you would not otherwise affect yourViewBean
and Model classes which are completely fine with the simplegetModel call.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getModel\(]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getModel\(]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
A similer rule can be applied to getSession and other CSpider APIcalls.
For instance here is the rule for converting getSession calls toleverage
the RequestManager.
<mapping-rule>
<mapping-rule-primarymatch>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-primarymatch>
<mapping-rule-replacement>
<mapping-rule-match>
<![CDATA[getSession\(\)\.]]>
</mapping-rule-match>
<mapping-rule-substitute>
<![CDATA[RequestManager.getSession().]]>
</mapping-rule-substitute>
</mapping-rule-replacement>
</mapping-rule>
----- Original Message -----
From: "Matthew Stevens" <matthew.stevens@e...>
Sent: Tuesday, August 07, 2001 12:56 PM
Subject: RE: [iPlanet-JATO] Use Of models in utility classes
Namburi,
I will post a document to the group site this evening which has
the
details
on various tactics of migrating these type of utilities.
Essentially,
you
either need to convert these utilities to Models themselves or
keep the
utilities as is and simply use the
RequestManager.getRequestContext.getModelManager().getModel()
to statically access Models.
For CSpSelect.executeImmediate() I have an example of customhelper
method
as a replacement whicch uses JDBC results instead of
CSpDBResult.
matt
-----Original Message-----
From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
Sent: Tuesday, August 07, 2001 3:24 PM
Subject: [iPlanet-JATO] Use Of models in utility classes
Hi All,
In the present ND project we have lots of utility classes.
These
classes in diffrent directory. Not part of nd pages.
In these classes we access the dataobjects and do themanipulations.
So we access dataobjects directly like
CSpider.getDataObject("do....");
and then execute it.
Since the migration tool does not do much of conversion forthese
utilities we have to do manually.
My question is Can we access the the models in the postmigration
sameway or do we need requestContext?
We have lots of utility classes which are DataObjectintensive. Can
someone suggest a better way to migrate this kind of code.
Thanks
Namburi
[email protected]
[email protected]
[Non-text portions of this message have been removed]
[email protected]
[email protected] -
Is there a Java utility class to help with data management in a desktop UI?
Is there a Java utility class to help with data management in a desktop UI?
I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
someone recommended JGoodies Bindings for Swing - will this work well and in FX?Many thanks for the reply.
In the servlet create an Arraylist and in th efor
loop put the insances of the csqabean in this
ArrayList. Exit the for loop and then add the
ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
>
In the jsp retrieve the array list from the session
and in a for loop step through the ArrayList
retrieving each CourseSectionQABean and displaying.
You can do this in a scriptlet but should also check
out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
AS -
Issue: Using utility class instance
Hi,
I need to use OIM APIs.
I am using Eclipse IDE and have made the settings accordingly.
I am able to connect successfully and also able to get the instance of factory class.
Also then I am able to fetch the instance of utility class, tcUserOperationsIntf.
But next when I am trying to call any method of this utility class using the instance, I am getting null pointer exception.
Kindly help.public class oimtest {
public tcUtilityFactory getUtilFacObject()throws Exception
try
ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
final Hashtable env = config.getAllSettings();
tcUtilityFactory ioUtilityFactory;
System.out.println("1");
tcSignatureMessage mysign = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
System.out.println("2");
ioUtilityFactory = new tcUtilityFactory(env,mysign);
System.out.println("3");
return ioUtilityFactory;
catch(Exception e)
System.out.println("Exception in establishing connection is: "+e);
return null;
public void mymethod()throws IOException, ServletException
String orgid = "Xellerate Users";
HashMap uidmap = new HashMap();
uidmap.put("Organizations.Organization Name",orgid);
int a=4;
Long userkey=new Long(a);
try
tcUtilityFactory ioUtilityFactory = this.getUtilFacObject();
System.out.println("4");
tcUserOperationsIntf userIntf=(tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
System.out.println("6");
String s=userIntf.toString();
System.out.println("It is"+s);
userIntf.disableUser(userkey);
tcResultSet urset=userIntf.findUsers(uidmap);
System.out.println("7");
if(!urset.isEmpty())
int len =urset.getTotalRowCount();
System.out.println("length:"+ len);
catch(Exception ex){
System.out.println("Exception is: "+ex.getMessage());
System.out.println("Exception is: "+ex);
I am getting the following output when calling mymethod() from the main class-
1
2
3
4
log4j:WARN No appenders could be found for logger (XELLERATE.ACCOUNTMANAGEMENT).
log4j:WARN Please initialize the log4j system properly.
6
It isThor.API.Operations.tcUserOperationsClient@2f4b20
Exception is: null
Exception is: java.lang.NullPointerException -
Dear Gurus,
I am new to Java and working on a Java Web Application which is already running.
1)
I found that the util class methods are static also not Synchoronised.
I feel this is wrong because if any 2 user accesses the methods concurrently
then those 2 users will not get expected results.
2)
Basically servlets are not thread safe. Then how actually it serves different users who are accessing
concurrently without any issues.
Can any one please clarify me the doubts?
Thanks in advance
GoudhamYou can declare servlets to be multithreaded. Servlet
containers are supposed to be able to instanciate a
different instance of a servlet for every simultanious
request if you tell it to in the servler descriptor.
Tomcat does this, and I'm sure that WebLogic, BEA,
and the Sun on do as well. That way you don't have
to worry about multi-requests hitting one instance of
a servlet object. This does add more overhead, but
sometimes that's ok.To be more precise, you can declare servlets to be non-thread-safe (i.e. SingleThreadModel). This has the affect of preventing concurrent requests from being dispatched to the Servlet instance. Most (in my experience, all) Servlet containers provide the means by which you can set the maximum size of the instance pool for a SingleThreadModel servlet.
Your best bet is to make your Servlet classes stateless and therefore inherently thread safe. To do this, simply don't define any non-final static or non-static fields and never change the state of those fields). This gives you the greatest scalability. If you must, then have your Servlet implement SingleThreadModel and define an appropriately sized instance pool.
Of course this won't do anything directly to deal with helper classes and their thread safety issues.
Chuck -
Where should I keep my utility classes...
Hi All,
I have WAR application and few ejb JARs which are sharing common utility classes. I have created a separate folder for my WAR application. ejb jars also are in the serverclasses folder.
Now the question what's the recommended destination for utility classes. Can I keep them in the WAR application.
regards,
Aravind.If you are totally unsure, you can create a folder somewhere, put the files in it and then add the folder to your $PATH.
-
Hello,
Can someone tell me where I should put utility classes in an .ear file when
they are being used by both the EJBs (in the .jar file) and the web app (in
the .war file). I tried just putting them in the root of the .ear file but
WL 6.0 still couldn't find them. Is there such thing as META-INF/lib?
Thanks in advance,
Rob LewisI remember that somebody else reported this problem - when the utility classes are
in the ejb-jar servlets do work, but JSPs fail to compile - that sounded like a WLS bug.
Here is the description of 6.0 classloading:
http://e-docs.bea.com/wls/docs60/programming/topics.html#1037589
Rob Lewis <[email protected]> wrote:
This doesn't appear to be the case. I have an EAR with a JAR and WAR in it.
I removed the utility classes from the WAR that were repeated in the JAR.
Then the JSPs failed to find those classes. JBoss lets you put utility
classes in a JAR in the EAR and then set 'Class-Path' in the manifest.mf to
point to it but this also didn't work for me in WL6.
I'm at a loss.
Rob
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]..
I think you can put them in either the JAR or the WAR and it willwork --
wl6 seems to use a single classloader for the entire ear.
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Rob Lewis" <[email protected]> wrote in message
news:[email protected]..
Hello,
Can someone tell me where I should put utility classes in an .ear filewhen
they are being used by both the EJBs (in the .jar file) and the web app(in
the .war file). I tried just putting them in the root of the .ear filebut
WL 6.0 still couldn't find them. Is there such thing as META-INF/lib?
Thanks in advance,
Rob Lewis
Dimitri -
Hi
I can write a small application and run it using (Windows XP sp3 Java6u14) in command window.
If I write a class I want to use in many little applications where (in what directory/folder) do I put that class so I can 'see' it in another compile?
I tried to put the myutil.class file in the bin folder (C:\Program Files\Java\jdk1.6.0_14\bin) as this is on the 'path' I also tried to place it in the same directory as my new application - the compiler just does not find myutil.class.
I compile it with in cmd window:
Javac -classpath /MyJavaUtil; myjava.java
In the code file for myjava.java I :
import myutil.class;
also tried
import myutil.java;
where myutil.class is the compiled code myutil.java and both are located in the folder c:\MyJavaUtil; and this folder is also located in the same folder as the java code I am compiling.
I get 'cannot find symbol'.
If I remove the inport and the reference to the class I want to use I the program works as expected (but clearly not as required!).I compile it with in cmd window:
Javac -classpath /MyJavaUtil; myjava.java
In the code file for myjava.java I :
import myutil.class;
also tried
import myutil.java;
where myutil.class is the compiled code myutil.java and both are located in the folder >c:\MyJavaUtil; and this folder is also located in the same folder as the java code I am >compiling.If this is what you mean in terms of your file structure:
c:\
|___MyJavaUtil
|___myutil.java
|___myutil.class
|___myjava.java
|___myjava.class... Then, while you are in c:\myjavautil, compile as follows:
javac -classpath . *.javaA few notes:
1) The above should work only if you have no package statement in either of the source modules;
2) If you do have package statements, remember that you must put your modules in actual directory spaces that match the package name; and because java is case sensitive - even though Windows is not - the case much match as well;
3) If 2 is true, then specify what you have done;
4) Adding to your System|Environment CLASSPATH will work, but you can easily create havoc as you go along and this approach is generally not recommended;
5) Utility classes can be jarred (w/o a specified manifest) and placed in your lib/ext folder, but this too is generally not recommended, since that folder is really for extension libraries to the delivered SDK. However, just for my own use, I do it;
6) Best approach has been recommended to you in above post - create a utility folder/directory and specify your classpath to it, ex:
c:\
|___myjava
|___MyJava.class
|___myutils
|___Chop.class
|___Search.class
|___Append.class... add the following to the top of each of the source modules:
// This is Chop.java
package myutils;... Then compile these from the myjava directory as:
c:\myjava>javac -classpath . myutils\*.java -
Utility classes in WebService EAR
What would be the best way to include utility classes in the Web Service EAR?
Thanks in advanceI remember that somebody else reported this problem - when the utility classes are
in the ejb-jar servlets do work, but JSPs fail to compile - that sounded like a WLS bug.
Here is the description of 6.0 classloading:
http://e-docs.bea.com/wls/docs60/programming/topics.html#1037589
Rob Lewis <[email protected]> wrote:
This doesn't appear to be the case. I have an EAR with a JAR and WAR in it.
I removed the utility classes from the WAR that were repeated in the JAR.
Then the JSPs failed to find those classes. JBoss lets you put utility
classes in a JAR in the EAR and then set 'Class-Path' in the manifest.mf to
point to it but this also didn't work for me in WL6.
I'm at a loss.
Rob
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]..
I think you can put them in either the JAR or the WAR and it willwork --
wl6 seems to use a single classloader for the entire ear.
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Rob Lewis" <[email protected]> wrote in message
news:[email protected]..
Hello,
Can someone tell me where I should put utility classes in an .ear filewhen
they are being used by both the EJBs (in the .jar file) and the web app(in
the .war file). I tried just putting them in the root of the .ear filebut
WL 6.0 still couldn't find them. Is there such thing as META-INF/lib?
Thanks in advance,
Rob Lewis
Dimitri -
JavaCard - methods in Util Class
Hi,
I found that all of array functions in Util class arrayCopyNonAtomic(...), arrayFillNonAtomic(...), arrayCompare(...)
.. invoke equivalent native method. There is no other computation at Java Layer. (if you see from decompile of API code)
So why array function should do this way? I can have an example, for the arrayCompare, we can iterate over all elements and do normal comparison. The same with arrayFillNonAtomic(...). The only function that requires native is related to atomic transaction.
Do you have any reasons for using native beside the speed?
thanks,
Hoang LongNative code can access the CPU instructions for this directly. Java byte code would be interpreted by the JCVM to eventually call the native instructions. The native code is more efficient and faster. You could do this in Java but it is also trivial in C/assembly.
Cheers,
Shane -
SOAP oracle xml sql utility class definition not found error
I have created a java class that connects to database using JDBC runs an sql statement and produces xml using Oracle XML SQL Utility class. The java class works perfectly when I deploy it as a soap web service and try to run through SOAP server it gives a SOAP error oracle/xml/sql/query/OracleXML/Query [java.lang.NoClassDefFoundError].
Can anyone help please.
Thanks
AlinaSounds like you have not included the xsu12.jar file in the server-side CLASSPATH.
This depends also on the xmlparserv2.jar and on the Oracle JDBC driver. Later versions
of XSU may also depend on the xdb.jar file, too.
Maybe you are looking for
-
Hi All, I am working on modification of the dunning report script (SAP VERSION IS 4.6C) . My requirment is to add few more lines in the address window in the script. The address window is VARIABLE type. When I am trying to do change in the change mod
-
SLDAccess set to true, but not available
Hi all, I get the following error when Running a Proxy to mail Scenario. This happens in the Call adapter pipeline Step of the receiver mail adapter. error message "com.sap.engine.interfaces.messaging.api.exception.ConfigException: SLDAccess set to t
-
Startscen.sh parameter is not working
Hi all Im running a scenario from a shell script in the following fashion sh bin/startscen GL_JOURNAL 001 GLOBAL -AGENT_URL=http://mycompanyhost:mycompantport/oraclediagent variable_input_file_name=$INPUT_FILE_NAME The scenario starts but the variabl
-
Internet Radio is NOT missing after all, hooray!
OK, Internet Radio is NOT missing after all. Its placement just has been made so illogical that as long as you try to find it by logic you will fail. This is what and where it used to be: an item "Radio" under "LIBRARY" in the side bar, its showing
-
Hi , I want to create a Formula in which I want to assign a value to a KF if a condition is satisfied... Any advise on how to write "If" statement in Formula in Bex ex: if char1 = "xyz" then KF = 0 Any help...