What is the best way to exit an application?
Hi
In many examples I have seen an eventlistener used to exit an applicaiton when the user closes the window. However I recently came across the method:
setDefaultCloseOperation(EXIT_ON_CLOSE)
Is this a better way to close an application? What are the pros and cons of each way and what is the most widely used in the industry.
Thanks
If you dont have anything special to do other than exit, this method would be ok. but if you want to save some properties before exit.. or want to ask user to save before closing or some other confirmation messages, closing network, database connections, etc etc, then you have to use event listener.
Similar Messages
-
What is the best way to port complete applications from DEV - Test - PRD?
Hi,
One of my customers recently asked me, Supposing I do the complete integrations and modelling in SOA Suite on the DEV Environment. Then,
What is the best way to port complete applications from DEV -> Test -> PROD ??
Also, since the URLs in use in the DEV environment would be very different from other environments, what is the easiest way to maintain them, and to build in Access Control mechanisms ?
Best RegardsHi AJ,
Nice PDF !
Though the PDF does give a basic idea as to how we can go about the deployments using ANT and EM in Test and Prod, it doesn't really give extensive details. For eg. ANT would obviously need huge ANT scripts to be written for migrations to multiple Test servers, etc.
Similarly, when we talk about EM, does it mean each of the services has to be manually deployed on Production ?
I am sure we would be looking more towards a fully automated solution. No ?
Best Regards
Nitin -
What is the best way to port complete applications from DEV - Test - PROD
Hi,
One of my customers recently asked me, Supposing I do the complete integrations and modelling in SOA Suite on the DEV Environment. Then,
What is the best way to port complete applications from DEV -> Test -> PROD ??
Also, since the URLs in use in the DEV environment would be very different from other environments, what is the easiest way to maintain them, and to build in Access Control mechanisms ?
Best RegardsIt has been discussed here in detail-
SOA 11g Composite Deployment across multiple Instances: Best Practice
since the URLs in use in the DEV environment would be very different from other environments, what is the easiest way to maintain them, and to build in Access Control mechanisms ?You may use deployment plan for this purpose. For access control, you may use Role Based access of Weblogic and EM. Please refer -
http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10226/appx_roles_privs.htm#BABIHDFJ
Regards,
Anuj -
What is the best way to deploy an application ??
Hi,
Please advise me how to automate in a best way to Deploy 10 different applications(.ear/.war)
to 10 different Clusters(containing 40 Managed servers) in wls6.1......and that
too in a Production environment.
I know that we can use weblogic Console to deploy an application BUT if i have
2 unix boxes and each box contains 4-4 clusters(each containing 16-20 managed
servers) .....then i have to open up 2 Admin server consoles to deploy each of
the respective applications and that too deploying these application to 8 clusters.....OR
i can use deploy commad to do the same.
AND if i have like 100 clusters .....then i would have to "deploy" 100 times ......
is there any way that we can BEST AUTOMATE this process.
Thanks a lot.
-sangitaThanks Tommy. but i would like to know a very important point here: this is using
the weblogic.utility that you just talkd about.
Suppose iam having an ADMIN server that has say 10 clusters and 50 managed servers
underneath to take care.
1 cluster each = 5 managed server
now iam deploying a simple .war file to say a single managed server, i have found
out that it takes a looot of time to get the application deployed.
what do you say about this situation ?
what is the best approach ??????
-sangita
"Tomy Mathew" <[email protected]> wrote:
>
>
To deploy the application from the command prompt in WebLogic 6.1 you
use the
following command
$JAVA_HOME/bin/java -cp $WL_HOME/weblogic.jar weblogic.deploy -port $WEBLOGIC_PORT
-host $WL_HOST_IP $WEBLOGIC_CMD $WEBLOGIC_PWD -component $WL_Server_NAME:$WL_Server_NAME
$WL_APPLICATION_NAME YourApplication.war
$WEBLOGIC_CMD sould be DEPLOY for the first time deployment and UPDATE
for redeployment
For deploying in a cluster you better create a shell script which call
the above
command with different cluster ip address as a parameter.
Tomy
"sangita" <[email protected]> wrote:
Thanks Rob for your expertise advise. I would check to see wls8.1's
ANT tasks.....for
wls6.1, i would guess shell scripts to be a better option for us.
thanks again.
Rob Woollen <[email protected]> wrote:
If you're using 8.1, then it's pretty nice to use ant for
configuration/deployment/starting and stopping servers etc. There's
a
wlconfig task to do configuration, wldeploy to deploy applications,
wlserver to start/stop servers.
For 6.1, it's probably not a huge win to use ant. It's up to you.
If
you're more comfortable using shell scripts, that's certainly a
reasonable route.
-- Rob
sangita wrote:
Thanks Rob.
But all the stuff that ANT can do for me FOR DEPLOYMENT (ONLY) .....ican do it
from a simple shell script too.
And i understand of ANT's cross-platform environment and usage of
JAVA
.....but
can i use ANT to do something like CONFIGURING my wls6.1 managed
servers/clusters/creating
managed servers/db connection pools ......and all the other configurationthat
i do from wls console(or manually) ....????
and if yes, do you know of any examples, suggestions, ideas ?????
basically, if i need to sell(?) ANT to my juniors ......what are
the
basic reasoning
i can put forward....keeping in mind that these guys use wls6.1 &
wls8.1......and
these guys do CONFIGURATION and DEPLOYMENT only.
sorry for asking, may be these silly questions.
thanks, sangita
Rob Woollen <[email protected]> wrote:
sangita wrote:
Thanks Rob.
Rob, do you still consider or suggest using ANT for deploying say
20
applications
on a 10 clustered environment.Yes
do you see any advantages using [ANT + weblogic.deploy]..... over
simply
using
weblogic.deploy utility ???Yes. ANT essentially gives you a cross-platform environment that
allows
extensibility through java. It's very powerful.
-- Rob
-sangita
Rob Woollen <[email protected]> wrote:
sangita wrote:
Rob,
I have found the answer for my question #1 ...this is the URL:
http://edocs.bea.com/wls/docs81/admin_ref/ant_tasks.html
iam still hoping to hear back from you for #2, #3
thanks a ton.
"sangita" <[email protected]> wrote:
Thanks Rob.
quick question:
1) do you know of any example which illustrates the use of ANT
wrapper....or
please
direct me to a URL where i can find some documentation about
it.
2) does this ANT wrapper has any advantages over using weblogic.Deployer
utility
??If you're doing deployment via ant, then it's a bit more convenientto
use <wldeploy> rather than invoking a raw <java> process, but
fundamentally it's just a wrapper around weblogic.Deployer
3) i would certainly check to see weblogic.deploy for wls6.1
....can
i use ANT
for deployment purpose in wls6.1 ?You'll just need to wrap it in a <java> task
See:
http://ant.apache.org/manual/CoreTasks/java.html
-- Rob
Rob Woollen <[email protected]> wrote:
If you were using WLS 7.0 or later, you could use weblogic.Deployer.
If
you were using 8.1, you could use wldeploy which is an ant task
wrapper
for weblogic.Deployer.
In WLS 6.1, you'll have to use weblogic.deploy which is a bit
cumbersome, but it's still certainly possible to script deployment.
-- Rob
sangita wrote:
Hi,
Please advise me how to automate in a best way to Deploy
10
different
applications(.ear/.war)
to 10 different Clusters(containing 40 Managed servers) in
wls6.1......and
that
too in a Production environment.
I know that we can use weblogic Console to deploy an application
BUT
if i have
2 unix boxes and each box contains 4-4 clusters(each containing
16-20
managed
servers) .....then i have to open up 2 Admin server consoles
to
deploy
each of
the respective applications and that too deploying these applicationto 8 clusters.....OR
i can use deploy commad to do the same.
AND if i have like 100 clusters .....then i would have to "deploy"100 times ......
is there any way that we can BEST AUTOMATE this process.
Thanks a lot.
-sangita -
What is the best way of persisting Web-application related data?
My web-application needs to persist some data (a set of XML documents), i.e. save them so that they can survive server or application shutdowns. Saving those documents as files in server's filesystem does not seem to be convinient to me because the container may run the application directly form WAR and it is impossible (maybe I am wrong?) to modify files inside WAR archive. Forcing WAR extraction requires container reconfiguration and is container implementation dependent, which is not acceptable.
What would be ideal is some individual persistent storage bound to an application which does not require any external enitites (external databases etc). And this storage should not depend on any particular implementation of servlet container.
So is there a way to do something like this?Saving it to disk seems like your only alternative.
Presuming you have at least some control over the machine where it is deployed to, you could specify a directory to save the xml documents to (ie not one under your web application structure) This would get around the limitations of the WAR file not being extracted.
Make the directory an environment variable/init parameter in your web.xml file.
All you need then is a directory on the server that you have write permissions to.
Ok it requires more setup when deploying the web application, but I thinks its about the only way to accomplish what you want to do. -
What's the best way of storing (configurable) application settings.
I'm developing an application that has a few dozen settings, which have a default value at installation time, however they may be changed at execution time.
The settings will not be set by the application directly itself, instead it provides an API which independant client applications can use to change the settings.
One client will be a debug/test GUI to view and set the settings.
Another client will be a sort of monitoring program that is able to receive setting updates sent to the device by some mechanism (i.e. HTTP or OTA etc.). When it receives the setting changes it will call the application API to change the settings.
My first question is
- in general what is a good mechanism for storing these settings? (The settings are small things, numbers etc.)
- if the settings are stored in a file or database etc., how can they be made tamper-proof from malicious programs, i.e. is it possible that the only program which can change the settings is my application?
- if my application is the only program which can directly change the settings, that's not secure if any malicious client can access my application's API. Therefore is there a mechanism whereby an application can police usage of its API to a known list of clients?
Thanksniuniu wrote:
- in general what is a good mechanism for storing these settings? (The settings are small things, numbers etc.)
Configurable settings are generally stored in a property list file (.plist). E.g. see Storing Dictionaries in the NSDictionary reference.
- if the settings are stored in a file or database etc., how can they be made tamper-proof from malicious programs, ...
In general, there's no such thing as tamper-proof. You need to decide on a level of security based on how important your program is and the consequences of a security failure.
- if my application is the only program which can directly change the settings, that's not secure if any malicious client can access my application's API. Therefore is there a mechanism whereby an application can police usage of its API to a known list of clients?
I guess you could require clients to logon in some fashion. But protection against an entity with knowlege of your API and the ability to install a malicious client requires a level of security far above what you've asked about so far. Simply identifying the client in this scenario is a little like securing a water heater against a 9.0 earthquake when we expect the entire building to collapse at 7.5.
For example, a priori I would look at your network input long before I would consider a malicious, local client.
I would suggest defining your security requirements in terms of what kinds of attacks you expect and how far you're willing to go towards a defense. At that point one of the security experts around here might be able to recommend some specific solutions.
Btw, the subject line of this thread doesn't reflect the more difficult security questions you're asking. A more accurate topic description makes the forum easier to search, and also gets the attention of the right experts. So if you don't get the kind of help you need, you might consider a new thread about data security.
\- Ray -
What is the best way to get data to a user interface?
Hi,
I'm using labview 6i. I have an application with a handful of "core" vi's that actually run my application, doing the data acquisition, analysis, and control. I am currently using these same vi's for my user interface. I also have a number of vi's that contain menu's for configuring the "core" vi's. My questions is, what is the best way to seperate the "core" vi's from the user interface vi's. Global's, data socket, control references, others?
Thanks for the help.Hi Sal,
I have been a strong advocate of control refnums ever since LV 6i hit the streets. I recomend you look into using them to provide this conectivity.
You could accomplish this by using a variation on the following.
In your UI, create refnums for each of the controls or indicators that must be monitored or updated. Pass the appropriate refnums to each of the "core.i's" at program init time. Inside each of the core.vi's, use property nodes to read the control's values when appropriate and similarly for display purposes. (Note: Not all boolean mechanical actions are compatible with this technique. In those case you will have to explicitly write false values after find the control to be true or vise versa).
By using this technique, you can keep the UI diagrams clea
n. Depending on your app. the UI diagram could consist of the init's I mentioned above, and a while loop that watches if it's time to exit.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
What is the best way to organize queue in R/3?
Hi,
I'm in a middle of a project, where I should implement queue in order to sync data between 2 systems - r/3 and legasy one. I have few user exits (or bussiness events), which could be rised concurently in time, and I need only 1 instance of the sync module to run at a time. Well, I know the technique to prevent a program from running in multiple processes, and I have an idea how to organize a queue (my idea is to use transparent table to track actions which should be sync-ed), but there allways are some 'bottlenecks' that should be considered in such an implementation.
That's why it might be of great help if someone could share his/her knowledge on this topic or point me to the right paper/docu, if available.
I just don't want to reinvent the wheel, if possible
Many thanks in advance.
Regards,
Ivaylo Mutafchiev
SAP BC Consultant - ABAP developer
Varna Bussiness Services Ltd.I'm not sure why you don't just invent a generic data structure (e.g., table name, list of column names and aliases of column names) such as:
class QueryMetaData {
private final String tableName;
private final String[] columnNames;
private final String[] columnAliases;
}Read into the above structure from a properties file, database table, etc. You can store meta-data itself in places other than enum constants, particularly if would like to change the meta-data without requiring a new build of your application.
That having been said, WRT to your specific questions:
(1) Finally, from your experience, what is the best way to organize all that stuff?See above
(2) I have heard that smart Java programmer should avoid using the enums by any means. Do you agree?Enums are better than simple constants using int or String or something similar. If there are known, discrete values unlikely to change frequently, I see no issues with an enum. They improve the readability of code, and there are enough syntactic sugar features in the language (switch statements come to mind) to make them appealing.
(3) Generally what will you prefer when creating a constant which has two values: two final Integers or enum?
See above. Enums were introduced (in large part) to do away with storing constants as integers.
- Saish -
What is the best way to create a bookmark for a returning user??
Hello all... hello again Steve...I am back with another question- what is the best way to implement a bookmark system so returning users can pick up where they left off in an AW lesson? I have tried the usual internet searches, always do, but the few samples/answers I have found were AW5, not much help...
I have a dozen or so maps attached to my framework, I would like a user to return to the last map he viewed before closing. (My AW is communicating fine with an Access database, so if passing a variable to Access and then back to AW when the lesson starts is on the right track, let me know...) If the answer here is too complicated, maybe nudge me in the right direction and I will dive back in.
Thanks in advance to anyone who has some guidance, I really do appreciate it!
TerryTry this outline, see if it helps ...
Grab a reference to the Map as you enter it, then save that to the database when you leave.
You want something that will give you the equivalent to a page number - if you have 7 maps hanging off the Framework, and the user is in the 6th map when he exits, you want to save the number 6.
There are scores of ways to do this, but probably the easiest is just to attach a calc to each map that has this code
(I don't have Authorwar handy to check syntax, so you should check!)
BookMarkPage = ChildIDtoNum(IconParent(IconID), IconID) <-- tells Authorware to return the "page number" of the current map
Save BookMarkPage to your Access database on exit .
On return, read the bookmark back into BookMarkPage, ask the user if he wants to return to bookmark. If yes, use a calculated navigation that uses
ChildNumToID(@the name of your Framework or it's ID, BookMarkPage)
Note that you could wrangle something similar by saving the IconID of your Map, or the IconTitle, but both of these can break if you ever update your file by adding or removing pages, renaming them etc. With this method, all you need is a simple page count check that ensures that you are not trying to nav to a page number that does not exist (use IconNumChildren).
Steve -
What is the best way to edit/sync two video files?
Has anyone had experience with editing 2 movies files? I have recently taken video with 2 cameras of the same quality and am attempting to 'merge' the two video files. What's the best way to 'sync' the 2 files?
ThanksThe real answer is to do this in Final Cut Pro X with the new multicam feature with automatic syncing using the audio wave forms.
However, it is quite possible in iMovie.
Here is how I did it in iMovie.
I recently did this for a video of my niece's senior voice recital. (Video is below)
The key is to use the Cutaway feature of iMovie. If you are not familiar with Cutaway,here is a good tutorial from Ken Stone.
I used the side camera as my base clips, and used the back camera as the cutaway clips. The back camera audio track was OK but had too much coughing and noise.
Here are tips for getting it lined up perfectly.
1) In iMovie/Preferences make sure that you check "Display Time as hh:mm:ss:frames" so you can edit to the frame level. (Also, select "Show Advanced Tools so you get the Cutaway feature)
2) In the iMovie Project View, set the thumbnail slider to 1/2 second so you have a great deal of control.
3) Initially, leave the volume at 100% on the Cutaway track, so that both tracks are playing. You can hear when they are off.
4) Click the "Waveforms" button in the Project view, so you get a visual cue of how to line up the tracks.
5) Between the audible cues and the visual cues, you can nudge the cutaway back and forth one frame at a time by dragging until you have it perfect.
6) When it is lined up to your satisfaction, set the volume slider of the Cutaway track to zero, and turn off the waveforms. You can also move the thumbnail slider back to 5 seconds or so.
7) For some of the fine work, I switched to the "single row timeline view". This slows you down a bit, but lets you see the waveforms more clearly.
8) I made heavy use of the iMovie Comment Marker feature. I watched the whole base video/audio track and inserted comment markers at the points where I wanted the Cutaway to begin and end. For example, a comment might say "Insert Cutaway 1". I would usually time the cutaway so it started at a distinct audio event, such as when the piano start. This comment marker made it easy to drag my cutaway to a point that was approximately correct.
9) If you need to do a lot of cutaways, I find that it helps to use the SPLIT CLIP command in your project. This way you can have a single cutaway per clip, and this makes it easier to manage and is less processor and memory intensive for iMovie. I would use the comments to mark the entry and exit points of the cutaway as described above. I would then select that portion of the clip that included these markers plus a little more, so that a yellow border is around the selection. Then right-click/SPLIT CLIP (or CLIP/SPLIT CLIP in the top menu). This does not physically splt the clip within the Event. It only virtually splits the clip in the project. -
What is the best way to get another object's method to update my GUI?
package stuff;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class Test extends JFrame{
private static JButton ProcessButton = new JButton();
private static JLabel jLabel2 = new JLabel();
public static void main( String args []){
Test f = new Test();
f.setSize(500,500);
Container c = f.getContentPane();
ProcessButton.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent e) {
jLabel2.setText("Connecting to DB");
//Connection connection = Tools.setUpConnectionToDB(url,userName,pwd);
c.add(ProcessButton, BorderLayout.NORTH);
jLabel2.setText("My Label");
c.add(jLabel2, BorderLayout.SOUTH);
f.setVisible(true);
{\code]
The method setUpConnectionToDB can take 1 - 10 mins to complete. By this time a user will prob have quit my app thinking
it's crashed because it doesn't update the GUI with a progress status. :(
What is the best way to get this method to update the GUI of the app which calls it?
Something like Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
ie this being a reference to the GUI's JFrame is what I'm trying to use?A handy class to know about but not really what I'm after.
I need the method call
Tools.setUpConnectionToDB(url,userName,pwd);
to be able to update a component ( The JLabel ) on the GUI
Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
[\code]
method defn:public static Connection setUpConnectionToDB( String url, String user, String pwd, JFrame f ){
//Why doesn't this code below modify the GUI on the calling App?
f.jLabel2.setText("Setting UP DB Connection");
f.repaint();
Connection c = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c = DriverManager.getConnection(url,user,pwd);
catch(ClassNotFoundException e){
JOptionPane.showMessageDialog(null , "Error loading DB driver");
System.exit(0);
catch(Exception e){
JOptionPane.showMessageDialog(null , "Error connecting to DB, check config file");
System.exit(0);
return c;
}[\code] -
I have five different people using 10 different apple devices on one itunes account in our family. We have had trouble sharing. What is the best way to set up itunes on our home network? We have purchased music that sits on icloud, but we also have music we have imported from our previous cd library. Our itunes program keeps crashing and dumping everyone's playlists. So far we have all been using just the one desktop computer to sync to because we can't figure out how to share the same librarly and playlists on multiple computers in our home so devices can be synced at any location as well as playlists and purchases be made.
What is the best way to set up itunes on our home network?
One iTunes library per person. One iTunes account per person.
If people wish to share songs, they can make copies.
When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated! -
Tried using Find My iPhone and it's offline. It (Find my iPhone) was set up. What do I do now? Do I report it stolen? What is the best way in getting back my iPhone if any? Thank you in advance.
Find My iPhone is good for misplaced iPhone but not good for thief and it was never meant to be.
You chance of getting it back is very small.
There are a few things you can try.
Try remote lock/wipe your iPhone through Find My iPhone.
https://www.icloud.com
You can report to the police, cell carrier (expensive cell charges for international calls, roaming etc)
Change all the passwords used in iPhone: Apple ID, E-mail, Bank Account ....
http://support.apple.com/kb/HT2526 -
What is the best way to read and manipulate large data in excel files and show them in Sharepoint
Hi ,
I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
What is the best way to read the data form the excel file in fastest and most efficient way.
2 nd Problem,
I have one excel file that has many rows each row contain some data that has certain keywords.
What I want is to segregate the data of rows into respective sheets(tabs ) in the workbook.
for example in rows have following data
1. Alfa
2beta
3 gama
4beta
5gama
6gama
7alfa
in excel
I want there to be 3 tabs now with each of the key words alfa beta and gamma.Hi,
I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
as there's size limitations (probably the default max size is 10MB).
Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com -
Custom Report : What is the best way ?
Hi!
My customer doesn't like native TestStand 's report layout. He would prefer something like the example enclosed to this post.
What is the best way to achieve this ?
XSL customizing (seems heavy work) ?
Using the report generation toolkit and a Word template ?
Any other idea ?
Attachments:
Report Style.JPG 115 KBHave you examined all of the examples found in the TestStand help:
Maybe you are looking for
-
Hello Gurus, I'm performing a RFCLookUp in Java Mapping with PI 7.1 (I can't use a Message Mapping), the XML I use to do the request is: <n:ZHRBAPINOMINA xmlns:n="urn:sap-com:document:sap:rfc:functions"> <PERNR>30</PERNR> </n:ZHRBAPINOMIN
-
Yosemite crashes with Logitech bluetooth touchpad
Mac Mini late 2012 with OSX Yosemite crashes and reboots constantly when there is Logitech bluetooth touchpad connected. However if I turn touchpad power off after few hour use, everything keeps working fine. Keeping touchpad powered all the time cra
-
Hi I am having to write a java app which will create pdf documents. Can anyone recommend any java-pdf apis I should use? Many thanks
-
Colour Management problems - media AE to Encoder
I have noticed that Adobe Media Encoder Doesn't seem to cater for colour management. Or make mention of how applies gamma adjustments to the content it encodes. Flash in particular. 1. I'm working in colour managed environment in AE (eg. Adobe 1998),
-
Screen layout control while creating the asset class
Hi friends, I am trying to create the new asset class by copying the existing asset class. As the time of creation i have changed the new account determination and screen layout rule. While saving the system is giving error message that - Screen la