ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportJava code in Java compute code

Post new topicReply to topic
Java code in Java compute code View previous topic :: View next topic
Author Message
yellowbee
PostPosted: Fri Apr 27, 2012 12:19 am Post subject: Java code in Java compute code Reply with quote

Acolyte

Joined: 14 Apr 2012
Posts: 58

Code:
MbMessage message = assembly.getMessage();
      MbElement element1=message.getRootElement().getFirstElementByPath("/XML/EMP");
      Object object1=element1.getFirstChild().getValue();
      String string1=object1.toString();
      String string2=string1.substring(5,10);
      MbMessage message1=new MbMessage(message);
      MbElement element2=message1.getRootElement().getFirstElementByPath("/XML/EMP");
      element2.setName("STUDENT");
      element2.createElementAsFirstChild(0x1000000,"SNAME",string2);
      //MbElement title2 = chapter2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, “title”,   “Message Flows”);
      element2.getLastChild().detach();
      MbMessageAssembly assembly1=new MbMessageAssembly(assembly,message1);
      out.propagate(assembly1);

------
what 0x1000000 indicates or describes in the line element2.createElementAsFirstChild(0x1000000,"SNAME",string2);

Thanks
Back to top
View user's profile Send private message
Esa
PostPosted: Fri Apr 27, 2012 12:29 am Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

It is not you own code, he?

If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created.

By the way, you should use parser specific constants instead of numeric values, e.g. XMLNSC.Folder.

And by another way and before anyone else makes the remark (they usually do), you should not use the deprecated 'XML' domain.
Back to top
View user's profile Send private message
yellowbee
PostPosted: Fri Apr 27, 2012 2:47 pm Post subject: Reply with quote

Acolyte

Joined: 14 Apr 2012
Posts: 58

masters let me know what is the meaning of 0x1000000 in wmb java compute node................
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 27, 2012 10:50 pm Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

@yellowbee
Esa wrote:


If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created.


Which part of this did you not understand. Did you not follow the link?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Sun Apr 29, 2012 3:44 pm Post subject: Re: Java code in Java compute code Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

yellowbee wrote:
Code:
//MbElement title2 = chapter2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, “title”,   “Message Flows”);

Even though this line is commented out, the non-ascii quotes don't really belong there.

Esa wrote:
By the way, you should use parser specific constants ...

... or the generic type constants.

Esa wrote:
If you look at the "javadoc" in the InfoCenter, you can see that it is the type of the element to be created.

But the v61 javadoc doesn't document the actual values for the type constants. Those are documented elsewhere. The v8 javadoc is a bit more complete, but the parser-specific values are subject to change from version to version ... that's another reason not to hardcode them.

yellowbee wrote:
masters let me know what is the meaning of 0x1000000 in wmb java compute node

For the given code, it could mean either MbElement.TYPE_NAME, or MbXML.Element.
Back to top
View user's profile Send private message
yellowbee
PostPosted: Sun Apr 29, 2012 11:59 pm Post subject: Reply with quote

Acolyte

Joined: 14 Apr 2012
Posts: 58

Thank you shaman
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Apr 30, 2012 2:36 am Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

yellowbee wrote:
Thank you shaman


You have gotten confused again.

you are a Novice (your rank) and your username is 'yellowbee'.
I'm a Jedi and my username is SMDavies99

As the number of posts you make rises, you reach different ranks. The gap between the ranks increases as you rise up the ladder.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
yellowbee
PostPosted: Wed May 30, 2012 4:01 am Post subject: Reply with quote

Acolyte

Joined: 14 Apr 2012
Posts: 58

Thank you..SMDavies99
Back to top
View user's profile Send private message
zpat
PostPosted: Wed May 30, 2012 5:07 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Don't forget to use ClearMessage() in JCNs. We had a major memory leak because this was not being done.

Please read this article for more info

https://www.ibm.com/developerworks/mydeveloperworks/blogs/aimsupport/entry/important_facts_about_garbage_collection_in_websphere_message_broker?lang=en
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportJava code in Java compute code
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.