Which is the best way for a function called identify the class name of the appellant.
Which is the best way for a function called identify the class name of the appellant.(1) sun.reflect.Reflection using the function call
Class caller = Reflection.getCallerClass(2);
System.out.println("Caller Class Name ::"+caller.getName());
Trace of function called battery 2) analysis of current threads StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
System.out.println("Caller Class Name ::"+stElements[3].getClassName());
Y at - it all the other ways to achieve the same. What is the best way?Called function does accept no argument, I don't want the arguments of function calling function called t.
Help, please.
With greetings
Paul
798185 wrote:
Which is the best way for a function called identify the class name of the appellant.Y at - it all the other ways to achieve the same.
SecurityManager
// 0 is the anonymous SecurityManager class
// 1 is this class (also works in static context)
// 2 is calling class
static Class getClass(int i) {
return new SecurityManager() {
protected Class[] getClassContext() {
return super.getClassContext();
}
}.getClassContext();}
Tags: Java
Similar Questions
-
What is the best way for foglight consume a webservice
I hope that this is has not been replied that a bazillion times and if it is please send me the link I'm open to that. What is the best way for foglight consume a Web service and respond with an alarm if the response from the Web service is not what is expexted.
for example, calls Foglight webservice to acme.com/areuup and he responds with correct status in json format process. If it does agree return, then foglight must send alerts to correct individuals.
Thank you
Kaleb
in the end, we have used a perl script to capture the webservice and treat it and tables configuration. Here is what has been written and created an agent custom.
I apologize to all those who find the bulky comments, but it's my edition of journal of the script. I removed the comments once the script has been published and used.
===
#! / usr/bin/perl
#############################################################
# Author: Kaleb J. Albee
# Depandancies: SOA webservice
# Engineers: Marc and Manu
# Date: 28/02/2013 perl: (v5.14.2) built for x86_64-linux-gnu-thread-multi
# Operating system: Linux 3.2.0 - 29-generic eam-ops-test #46 - Ubuntu SMP Wed Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
#############################################################
use strict;
use warnings;
use Try::Tiny;
use SOAP::Lite;
use SOAP::WSDL;
Use Time::Local;
My = @soaenvs ('BSE - dev', 'BSE test', 'BSE-scene', 'BSE');
# parameters: $_ [0] receives a call of SOAP client object.
#
void toStr {return $_ [0] == 1?} 'up': 'down' ;}
void getBusResults {}
# $_ [0] will be the $client spent
# create a different buses SOAP connection.
my $result = $_ [0]-> (getMessagingEngineHealth)
# arg0 is used to set the setting for what is expected on the soa web service.
SOAP::Data-> name (arg0 => $_ [1]));
# $_ [1] will be the bus happened in
return (Lk ($result) "started" eq? 1: 0);
#return $result;
}
# Start sampling.
My $curTimeStamp = "";
my $count = 0;
Print "LdsEsbBusHealth5\nSTART_SAMPLE_PERIOD\n TABLE";
foreach my {$soae (@soaenvs)
my $client is SOAP::Lite-> service ("put the url of the webservice here.");.
$count ++;
# create an object to inspect objects. My $insp = Data new::Inspect->; Download the time stamp for this.
my ($sec, $min, $hr, $day, $mon, $year) = localtime;
# format the year correctly for useage.
My $curyear = 1900 + $year;
# the hand to the fglam agent fields at the tables.
My $soacei = getBusResults ($client, "messaging.000 - CEI.esb.BUS");
My $soaapp = getBusResults ($client, "messaging.000 - SCA.APPLICATION.esb.Bus");
My $soasys = getBusResults ($client, "messaging.000 - SCA.SYSTEM.esb.Bus");
$curTimeStamp = ' $curyear$ MON$ day$ hr$ min$ s ";
Print "SoaEnv.String.id=$soae\n";
Print "CeiBusNum = $soacei\n";
Print "AppBusNum = $soaapp\n";
Print "SysBusNum = $soasys\n";
Print "CeiBusStr.StringObservation.obs =". toStr ($soacei). "\n";
Print "AppBusStr.StringObservation.obs =". toStr ($soaapp). "\n";
Print "SysBusStr.StringObservation.obs =". toStr ($soasys). "\n";
Print "Daterun.StringObservation.obs=$curTimeStamp\n";
If ($count<=>=>
Print ("NEXT_SAMPLE\n");
}
} {$soae foreach (@soaenvs) #.
Print "END_TABLE\n";
Exit 0;
===
I hope this helps someone out there!
Bravo!
-
What is the best way for this situation?
Hi I have a xml file in my application. over a period of time, I have to add some nodes to the existing xml file.
In my business logic when a particular condition is met I have to add a child node to the existing parent for an existing xml file node.
What is the best way to do it? which api is best for this?Myriam wrote:
DOM parser, we can parse the xml file but can write us in XML file?Sure. This is the opposite operation of analysis, and it is called "Serialization".
The usual to serialize a DOM to a file is to create a transformer and to apply the transformation of identity for the DOM. However there are also third party XML serializers that do not take this approach.
-
What is the best way for a J2EE developer with oracle?
Hello
I am a J2EE developer, for the moment I'm working in a commercial bank as an enterprise application developer. Java, I learned when I was following a degree of local COMPUTER and with the help of books, work at my place of work and the internet, today I develop applications with JSP, Servlets, JSF2.0, EJB3.0 and third-party J2EE part libraries JSF etc (I also develop software using other programming languages such as Asp.net, c# .net, etc. WPF, but I prefer to be in the path of java). Other than that, I also work as the designer of the user interface of most of our applications.
I have the skills and practice after having worked for 4 years as a developer of web/enterprise applications & UI designer, but now I have to focus on some grades of paper and so I do BCS.
Now, I want to be a professional in the Oracle java path, and I need to know what is the best way, I choose to go with Oracle. I finished my SCJP courses, but did not take the exams, because there were rumors that Oracle will clear these reviews in the future. I am interested in Oracle university, but I'm unable to even think about it as I live in Sri Lanka and is not only a large part of the wealth to go to the USA and join.
So I really appreciate if any professional Oracle could suggest me the best educational path based on what I mentioned about my technical and professional training. Because I have a dream to join Oracle a day as an employee and be a good contributor on the same forum, which I get help today!
:-)
Thank you!!!As you can see on our Web site, Oracle did not retire Java certifications. You can browse through the available certifications and I hope to help determine your path.
http://education.Oracle.com/pls/web_prod-PLQ-dad/db_pages.GetPage?page_id=140SCJP became Oracle Certified Professional Java Programmer. You can find more information on these reviews on our site here: http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=320.
Concerning training, virtual training live might be an option for you. You can find more information at http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=233.
Kind regards
Brandye Barrington
Certification Forum Moderator -
Best method for writing functions
Hello
These are two functions. They are almost the same, except the "select into".
Y at - it a good way to combine the two functions and how best to reduce the code pl/sql unnessary?
Published by: Muriel Ram on December 7, 2009 12:34FUNCTION get_row_total_text RETURN VARCHAR2 IS my_row_count_total_text VARCHAR2(10000); BEGIN my_row_count_total_text := ''; -- generate the 'total' column function call SELECT 'edr_rpt_lane_by_class_package.gen_total_lane_count(' ||'lane_id, ' ||'direction_id, ' ||'interval_start_date_time, ' ||'interval_end_date_time, ' ||'range_low, ' ||'range_high, ' || MIN(site_lane_id) || ', ' || MAX(site_lane_id) || ') "COUNT"' INTO my_row_count_total_text FROM edr_rpt_tmp_report_lanes ; RETURN ', ' || my_row_count_total_text; END; FUNCTION get_row_total_pct RETURN VARCHAR2 IS my_row_count_total_text VARCHAR2(10000); BEGIN my_row_count_total_text := ''; -- generate the 'total' column function call SELECT 'edr_rpt_lane_by_class_package.gen_total_lane_count_pct(' ||'lane_id, ' ||'direction_id, ' ||'interval_start_date_time, ' ||'interval_end_date_time, ' ||'range_low, ' ||'range_high, ' || MIN(site_lane_id) || ', ' || MAX(site_lane_id) || ') "%"' INTO my_row_count_total_text FROM edr_rpt_tmp_report_lanes ; RETURN ', ' || my_row_count_total_text; END;
Published by: Muriel Ram on December 7, 2009 12:36Try the following (not tested):
FUNCTION get_row_total_text
RETURN VARCHAR2
IS
my_row_count_total_text VARCHAR2 (10000);
my_row_count_total_text_1 VARCHAR2 (10000);
my_row_count_total_text_2 VARCHAR2 (10000);BEGIN
my_row_count_total_text: = ";
-generate call function of the column 'total '.
SELECT ' edr_rpt_lane_by_class_package.gen_total_lane_count_pct (')
: ' lane_id, '
|' direction_id, '
: ' interval_start_date_time, '
: ' interval_end_date_time, '
|' range_low, '
|' range_high, '
|| MIN (site_lane_id) | ', '
|| Max (site_lane_id)
IN my_row_count_total_text
Of edr_rpt_tmp_report_lanes;my_row_count_total_text_1: = my_row_count_total_text | ') 'COUNT' ';
my_row_count_total_text_2: = my_row_count_total_text | ') "%"';RETURN «,» | my_row_count_total_text_1 | ',' | my_row_count_total_text_2;
END;
You can still find to find answers for questions of Justin...
-
Hang the function call after Document Class' Event.ADDED
I tried to load an external SWF (which contains the code below in its document class) with the charger of class but I keep getting Error #1009: cannot access a property or method of a null object reference. So I tried to use the Event.ADDED event listener in the constructor of MyDocumentClass of the external SWF file to leave the document class to be part of the display list, before I have to call createRandomGraph. But when I place createRandomGraph() inside onStageReady, the compilation process is suspended. When I left the createRandomGraph() inside the constructor, it works perfectly as isolated but will produce error 1009 so loaded in the SWF loader. Any ideas?
public void MyDocumentClass)
{
this.addEventListener (Event.ADDED, onStageReady);
createRandomGraph ( )
}
private void onStageReady(oEvent:Event): void
{
this.removeEventListener (Event.ADDED, onStageReady);
}
private void createRandomGraph(): void
{
var cRandomGraph:RandomGraph = new RandomGraph();
cRandomGraph.x = 10;
cRandomGraph.y = stage.stageHeight - nH - 25;
cRandomGraph.setDimensions (nW, nH);
cRandomGraph.createGraphBackground ();
this.addChild (cRandomGraph);
}
use:
public void MyDocumentClass)
{
this.addEventListener (Event.ADDED_TO_STAGE, onStageReady);
}
private void onStageReady(oEvent:Event): void
{
this.removeEventListener (Event.ADDED, onStageReady);
createRandomGraph();
}
private void createRandomGraph(): void
{
var cRandomGraph:RandomGraph = new RandomGraph();
cRandomGraph.x = 10;
cRandomGraph.y = stage.stageHeight - nH - 25;
cRandomGraph.setDimensions (nW, nH);
cRandomGraph.createGraphBackground ();
this.addChild (cRandomGraph);
}
-
What is the best way for users to ask questions about an extension?
Hi all!
I developed an extension that I thought I would share it with the community and saw that adobe provides a neat platform do with almost no effort on my side
One thing, this is where they can discuss my extension?
I don't think that email is a good idea, because it makes you answer always the same questions, a forum is much better.
I've seen you suggest that they do here.
But then messages on all extensions will be mixed up.
How can I subscribe to messages just with my extension? I don't want to be notified for all messages for all extensions!
-Maybe I could start a specific thread for my extension and tell people to go there. Not very nice but seems simpler. Which would be ok with you?
-Maybe there is a way to subscribe to just a tag / keywords? That could be better I think.
-Best would be a secondary space (and maybe a bug tracking system?) Christmas is not that far )
Thanks in advance!
Yannick
Mr Yannick
I suggest starting a new thread about your product and then adding a hyperlink directly to the thread of your page Product Description on the site of modules. You can choose to follow and to bookmark the thread for quick and easy access.
Kind regards
Krystal - Exchange / modules team
-
Toshiba Satellite M60-154: what is the best way for a long service life of a battery?
Hello Toshiba-users,
I bought the "Toshiba Satellite M60-154" but I want to use most of the time on the AC adapter.
I read the manual, but they say nothing about the battery life for people like me who will use the computer power adapter laptop most of the time.
I would like to know if:
(1) it is best put the battery inside when I use the laptop on the power adapter for a long time (they say this is not good for the life of the battery when it is fully charged and when he is still in charge...)
(2) it is best to take the battery when when I use the laptop on the power adapter for a long time and check the battery every week for example to see whether or not it is still loaded (they say it's good for the life of the battery when the battery is fresh off once a week)
Indeed, what should I do to make sure that the battery will have a long life, knowing that I always use the laptop on the power adapter instead.
Thanks for the tips
[Edited by: admin on 28-Sep-05 17:28]
Hello
your info is just. Only put the battery in the laptop, if you want to load or work without mains, to make sure that your battery has a long service life relative.
Good bye
-
What is the best way for us to buy Adobe Acrobat Connect Pro?
We currently use the creative cloud and want to use Acrobat Connect Pro to our Webinars. Is Adobe Connect, a part of the creative cloud or package package that we can choose which includes Adobe Connect?
Hello
Please see buying guide for conferences web solutions | Acrobat Connect Pro
Kind regards
Sheena
-
The best way for the interaction with the user?
Hello
Because they remove the views of the web in version 6.0.0 what would be the best and most simple way to 'capture' a user entry in a running workflow?
- The web client of vSphere
- The portal of vRealize automation
- THE REST API
-
Best way for the customer to download for a box?
I do a total makeover in an existing site and switch from GoLive to DW. We had a need for the client to display rapidly changing information in a box on the home page, since the client isn't real "techno" I tried an easy solution. What I have on the old site is an image I linked to Google Docs: he is editing a document on Google Docs and saving it, the link of the image I always points to a single document.
It works fine, but I wonder if there is a better way to accomplish the task. I have shell access to my Web host, so I peut play around the coast host if necessary.
Thanks - John
Try this http://www.cushycms.com/
I think this would work well for your needs.
-
the best way for the database pending?
Hello
I heard that DataGuard and streams are two ways to have a database waiting ready in case of failure of your normal database?
Can someone please share their experience of using one of these for that I decide that I should research on?
Thank youHello
As many of them into account in the light of the very valuable information for your query. Simply add a note for my part, hope that helps a small drop in the ocean.
I Opt for Data Guard - if your high level point of view check, go forward oracle specializing the two things, based on the environment and specialization. Keep data specialized in disaster recovery and HA and where as flow for replication. We are used to dealing in the requirement but vice verse - and we must go against the main base of the use of the tools and basic concepts and intended, that might create a problem / problems in the future...
-Pavan Kumar N
Oracle 9i / 10g - OCP
http://oracleinternals.blogspot.com/ -
What is the best way for a small System Builder to sell Window 7?
I'm starting to build specific systems of WMC. Some will be personalised, but many will be identical. I would like to create a Win7 installation with all the drivers and applications disc. What is my best and shortest path to follow and how do I buy and resell the license? What are my limits of cost and reseller price?
http://www.Microsoft.com/OEM/en/licensing/sblicensing/pages/index.aspx
-
What is the best way for possibly printed text?
Hello
I am a teacher and my exams in inDesign (because the formatting is much more reliable than Word!).
In my reviews I leave a space for students to write by making a series of highlighted tabs the full width of the text box, then line break and repeat.
I want to add the fixed in this sense the answer printed in OPTION. So in a single document, I can print the question on the examination, then print the answer key. I'm hoping not to have to duplicate questions in a second layer, as this then I would have to change in two places, if I need to change the question. The same would go for a layer of recovery with the answers in this document, that would depend on the same positioning two layers.
Can anyone offer advice on how to design a document that allows the full width students to write nonprinting text AND lines on the lines that can be optionally printed.
CS6 on OS X 10.9 using.
Please ask if I did not provide enough detail.
Thank you.
-James
I think you can do this by using conditional text. Select the responses, and then create a condition. And then you can choose to hide all text with this condition.
-
best way to avoid the full table scan for clause "column is zero.
I have a query with is control null, and because of that it performs a total scan of table (in millions of rows in the table)
SELECT id, x,
LAG (id) OVER (PARTITION BY userid ORDER BY has had place, id) as p_id,.
FROM MyTable
WHERE X is ZERO
What is the best way for me to avoid the full table scan. I have indexes for the X column and other columns.
Thank youHi Vasif
NULL values are indexed if the indexed entry also includes a value non-zero.
If you create an index such as:
CREATE INDEX mytable_x_idx ON mytable (x, ' ');
ensure all null values for the column X are indexed and will therefore potentially use the index to search for null values, assuming of course the result set is small enough to justify the use of the index in your query.
I have spoken previously on my blog:
http://richardfoote.WordPress.com/2008/01/23/indexing-nulls-empty-spaces/
See you soon
Richard Foote
http://richardfoote.WordPress.com/
Maybe you are looking for
-
I need a driver for sony walkman model # NWZ - E463.
I need a driver for sony walkman model # NWZ - E463. Can anyone help.i do not available for download. appreciate any help. Thank you, Bob
-
The training application has suddenly stopped
Hello I bought my W450 8 GB about two months ago. I had no problem with all the features of the unit (play music, bluetooth pairing with headphones and phone with a phone notifications not manufactured by motorola, phone calls via the W450, GPS, form
-
HP G56 Notebook: Replacement hard drive on a laptop G56
The hard drive on my G56 died. "No HDD found", said currently, a 500 GB Sata 2. Can I put a 1 disc? There are a lot online that claim to work with this laptop. They are not formatted, and I know I have to buy windows again, but will I need to install
-
Hello IM using the USB-6009 to recover my data. After a 6 month break, when I ran my VI A dialogue box that says "loading lvlib" arose before the opening of the VI. When I run the VI I get an error '201003' (Image 3) (it was working perfectly well be
-
I'm not able to log in and update my games for windows live profile.
I get an error while updateing my account on any network issue but my network works fine.i am not able to play halo2 for this reason online!