Sreeraj G Harilal

Ranch Hand
+ Follow
since Apr 19, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sreeraj G Harilal

I have a doubt about decorator design pattern.


Codes with decorator


Codes without decorator



This is the main class


With both set of classes, when we execute main class the result will be the same. If that is the result, what the decorator is?
Can anyone give a brief decription about the assignment that you have done.
Atlest give me the title that you gave to your project. Pleeeese
What happend to the SCDJWS exam?
Congrats!!! Deepak Kanwar

great score
Congrats Prasanna.

Well, I have some prior experience on Stateless Session bean.


I started preparing on 7-Feb



Why you are not including the experiance in your preparation period?
18 years ago
Look at the below code

EJB Object



EJB Home


Session Bean

import javax.ejb.*;
public class FortuneBean implements SessionBean
{
private String[] yourFortune = {"Fortune and glory, kid. Fortune and glory",
"You're gonna get killed chasing after your damn fortune and glory!",
"Feels like I stepped on a fortune cookie!",
"The fortune cookie will slip right through your fingers!",
"It's not a cookie, it's a bug!",
"It is your time to do research and dig up the treasure!",
"It is your year!",
"While looking for a fortune cookie, hold on to your potatoes!",
"You are in a position unsuitable to give orders!"};

String name = "No Name? " ;
public void ejbActivate()
{
System.out.println("From ejbActivate()");
}

public void ejbPassivate()
{
System.out.println("From ejbPassivate()");
}
public void ejbRemove()
{
System.out.println("From ejbRemove()");
}
SessionContext sc;
static int count;
public void setSessionContext(SessionContext ctx)
{
sc = ctx;
count++;
System.out.println("From setSessionContext()");
try
{
FortuneHome home = (FortuneHome)sc.getEJBHome();
Fortune fortuner = home.createMessagesWithName("Athulya " + count);
//Fortune fortuner = home.create();
System.out.println(fortuner.getNextFortune());
System.out.println(fortuner.getMyMessage());
}
catch (Exception e)
{
e.printStackTrace();
}

}

public String getNextFortune()
{
System.out.println("From getNextFortune(): ");
int randomNum = (int) (Math.random() * yourFortune.length);
return name + " -> " + yourFortune[randomNum];
}
public String getMyMessage()
{
System.out.println("From getMyMessage(): ");
return name + " -> " + " None but the brave deserves the fair.";
}
public void ejbCreate()
{
System.out.println("From ejbCreate()");
}
public void ejbCreateMessagesWithName(String name)
{
System.out.println("From ejbCreateMessagesWithName()");
this.name = name;
}
}



Inside the setSessionContext() method, i am creating another bean. So the creation of beans must go on infinitly. right?

But when i run the client code, it starting with continous creation of beans. But its stops automatically within some seconds.

Please anyone tell me why it is stoping the execution?
Hi all,
I am planning to take SCEA. Is it compulsory to pass exam 1 for the assignment project(exam 2)?
How can i get the assignment?

Please give me the details about the exam.
Setup files :-
1) j2sdk-1_4_2_13-windows-i586-p (JDK 1.4)
2) j2sdkee-1_3_1-win (J2EE 1.3)

Installation steps :-
1) Install jdk 1.4. (My installed path is - D:\j2sdk1.4.2_13)
2) Install j2ee 1.3 (My installed path is - D:\j2sdkee1.3.1)

Environment variable settings for windows:-
Control Panel -> System -> Advanced -> Environment Variables

1) PATH = C:\WINDOWS\System32;C:\Windows;D:\j2sdk1.4.2_13\bin;D:\j2sdkee1.3.1\bin
2) CLASSPATH = .;D:\j2sdk1.4.2_13\lib;D:\j2sdkee1.3.1\lib;D:\j2sdkee1.3.1\lib\j2ee.jar
3) JAVA_HOME = D:\j2sdk1.4.2_13
4) J2EE_HOME = D:\j2sdkee1.3.1

Starting Server :-
1) Run Command Prompt
2) type j2ee -verbose <enter>

Sarting Deploy tool :-
1) Run another Command Prompt
2) type deploytool <enter>

Stop and cleanup Server :-
1) Run Command Prompt
2) type cleanup <enter>
Ok Rajan Murugan, I will give the details of Installation and environment setup in detail.

Please wait for sometime(today evening. because i am really busy now).

Good.So what was it that you did now that you didn't do last !!??


Rajan Murugan, don't do. don't do.

I think my environment variable settings was wrong.
Anyway its working fine now.
Tanakorn make my brain cool with his cool reply.
Tanakorn Numrubpor, now its working fine.

Thank you very much

Server starts fine and deploytool is also started. Looks everything works fine. But i didn't check the code till now. I am going out now. Today evening i will start Head First EJB
Rajan Murugan,

jdk 1.2 is obsolete version.J2SE 2.0 was never released.Both of you clarify this.further if you are working on SCBCD 1.3 you need the said server.No point in deleting the setup and/or installation.



I deleted j2ee 1.3 because i decided to study EJB 3.0 after failing to configure the j2ee 1.3 server.
Tanakorn,

I started downloading JDK 1.4 and J2EE 1.3. It will take 1 hour.
I will tell you the results after i install it and configure.