Sowm Herur

Ranch Hand
+ Follow
since Jul 07, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sowm Herur


Hi,

I have a following requirement.

I need to deploy weblogic application to a remote server which has weblogic application server installed using command line reference. I'm using WebLogic 10.0 application server. I'm able to deploy using command line using the the command to a standalone machine ie java weblogic.Deployer -adminurl http://localhost:7001 -username weblogic -password weblogic -deploy C:/ISRA.rar

But i am not sure how do i deploy the same application to a remote machine.Can someone clarify on this?
How do i run the command from the source machine so that the application gets deployed on the remote machine having weblogic application server.

Can i run this command from source machine as my source machine doesn't have weblogic application server installed.

Can someone shed light on this and help me on how do i go abt it?
11 years ago

Hi,

Is there any deployment script i can write for jboss which can deploy my web applications, resource adapter and start and stop my application server and then call this scripts from php so that it will directly get executed?

Please suggest if jboss has some scripts like python/jython as WebSphere or Weblogic..
11 years ago

Ok i understand now but why are we creating an instance of the static variable?

Static variables doesn't have any instance rite?
11 years ago

But my question in this case a static variable which is declared doesn't require an instance to be created?
Then why are they creating an instance of the Random_Generator?
11 years ago

We are creating a RANDOM_NUM_GENERATOR instance of Random class even though the Random class is static.Why is it so?

Please explain

private static Random RANDOM_NUM_GENERATOR = new Random();
11 years ago

Reposted it:



This is one example of static member. As static member value is shared between different objects the value of counter gets incremented as many objects we create.

The output we get for the static example is 1,2

But say in the below example if i make the counter to int counter=0;
Then the output is 1,1
Does this mean that every object has a copy of its variable like int.





public class StaticMemberExample {

public static void main(String[] args) {

ObjectCounter object1 = new ObjectCounter();
System.out.println(object1.getNumberOfObjects());



ObjectCounter object2 = new ObjectCounter();
System.out.println(object2.getNumberOfObjects());

}

}


class ObjectCounter{

static int counter=0;



public ObjectCounter(){


counter++;
}




public int getNumberOfObjects(){

return counter;

}

}
11 years ago
This is one example of static member. As static member value is shared between different objects the value of counter gets incremented as many objects we create.

The output we get for the static example is 1,2

But say in the below example if i make the counter to int counter=0;
Then the output is 1,1
Does this mean that every object has a copy of its variable like int.


/*
2.
Java static member variable example
3.
This Java Example shows how to declare and use static member variable inside
4.
a java class.
5.
*/
6.

7.
public class StaticMemberExample {
8.

9.
public static void main(String[] args) {
10.

11.
ObjectCounter object1 = new ObjectCounter();
12.
System.out.println(object1.getNumberOfObjects());
13.

14.
ObjectCounter object2 = new ObjectCounter();
15.
System.out.println(object2.getNumberOfObjects());
16.

17.
}
18.
}
19.

20.
class ObjectCounter{
21.

22.
/*
23.
* Static members are class level variables and shared by all the objects
24.
* of the class.
25.
*
26.
* To define static member, use static keyword
27.
* e.g. static int i=0;
28.
*
29.
* Please note that static member variables can be accessed inside
30.
* non static methods because they are class level variables.
31.
*
32.
*/
33.
static int counter=0;
34.

35.
public ObjectCounter(){
36.

37.
/*increase the object counter. Since only one varible is shared between
38.
* all objects of this class, it always return number of objects till now.
39.
*/
40.
counter++;
41.
}
42.

43.
//returns number of objects created till now
44.
public int getNumberOfObjects(){
45.
return counter;
46.
}
47.
}
11 years ago

I wanted to understand as String are also objects they can be just put in a hashmap using map.put("Name","Sowmya");
As string are objects implicitly we need not create instance of string like what we have done for long creating a map.put("Reg-no",new Long("23")) instance?
Hashmap map=new Hashmap();
map.put("Name","Sowmya");

say for reg-no we need to put it like

map.put("Reg-no",new Long("23"));

11 years ago
Please go through the following example:I have always known that a hashmap take objects as parameters. So if the parameters to the map are String objects , so is that the reason we are able to insert into the paramsMap() object?

public static final String FUNCTION_NAME = "functionName";
public static final String CREATE_FOLDER_FUNCTION_NAME = "CreateFolder";
public static final String INTERACTION_VERB = "interactionVerb";
public static final int SYNC_SEND_RECEIVE = 1;
public static final String EXECUTION_TIMEOUT = "executionTimeout";




HashMap paramsMap = new HashMap();
paramsMap.put(ATT_Macros.FUNCTION_NAME,
ATT_Macros.CREATE_FOLDER_FUNCTION_NAME);
paramsMap.put(ATT_Macros.INTERACTION_VERB,
new Integer(ATT_Macros.SYNC_SEND_RECEIVE));
paramsMap.put(ATT_Macros.EXECUTION_TIMEOUT, new Long("10000"));




11 years ago

What is the difference

Temperature temp=null;
Double Temp=new Temp("23");

I dont get the difference between these two?
Please explain
11 years ago
How do we decide on when to create primitive variables and when to create objects?
Can you explain it with sceanario's
11 years ago
[Deleted as not relevant to this thread]

11 years ago
Hi Lee,

This is not the kind of response i expected from you.
If you have patience to explain it to the beginners of java please respond, or else please don't post such rude replies.This is not all professional behaviour from you.
I don't want help from people like you.

11 years ago
Can a non static class access the static methods of static class?

Please explain with a simple example
11 years ago