Skip to main content

Annotation

  8 posts   Feedicon  
Replies: 7 - Last Post: January 18, 2012 13:19
by: oneminutedistraction
« Older Topic » Newer Topic
showing 1 - 8 of 8
Posted: January 12, 2012 08:15 by renclav
Hi,

Could someone please let me know how to replicate the following using the latest libraries:

@Namespace(uri=”http://http://jabber.org/protocol/chatstates”, parameter=”{chatstate}”)
public String handleOthers(@Parameter(“anyone”) String name
, @Parameter(“body”) String message)
, @Parameter(“chatstate”) Element chatstate) { ....
.... }


The requirement is to capture chatstate message in their own method.

Thank You,
Dylan
Posted: January 12, 2012 08:34 by oneminutedistraction
You're using the old API. I've refactored the names since

@XmlElement(namespace="http://jabber.org/protocol/chatstates", parameter="{chatstate}")
public String handleOthers(@Bind("chatstate") Element chatstate ... ) {

@Namespace
no longer exists. Use
@XmlElement
instead. It is a lot more powerful. You can match tags as well
@Parameter
have been change to
@Bind

If you are using CDI, you can use
@Named
eg.
@Named("chatstate") Element chatstate
instead of
@Bind


Need to document this when I get the time
Posted: January 12, 2012 10:03 by oneminutedistraction
Found a bug with XmlElement binding. I've just uploaded it. Should work now. Thanks for putting up with the alpha software.
Posted: January 16, 2012 09:52 by renclav
Thank You Smile

Could you please update the netbean plugin version numbers since I can not update my libraries without installing a new netbeans or somehow deleting the plugins.


Dylan

PS
(your library will serve a user base of over a million soon enough, just figuring out how many instances we will need)
Posted: January 17, 2012 08:44 by oneminutedistraction
Yes I've not been keeping up to date with the version number in NB. You don't need to reinstall NetBeans. Just delete the .netbeans directory in your home.

BTW I'm curious what are you using it and how are you using it. Let me know if you came across some use cases that you would like Vorpal to support. I just came across a use case yesterday that currently is very badly supported in Vorpal. I'm in the process of implementing the feature. Will blog about it once its done.

Keep me updated on your project.

Regards
Posted: January 18, 2012 07:34 by renclav
Hi,

When you have a time, could you please update the netbeans plugin version in' XMPP PROJECT'. Deleting the .netbeans folder would throw a spanner in the works of too many current projects.

I'll be sure to check your blog regularly. I can not say much here. For now, I am using vorpal to modify and redirect messages to create interactive communication in a chat centric manner. If you want, add me on twitter @renclav and I'll send a message with my email address if you want to know more.

Questions:
1. How would I send a message from a component without the component receiving an IM packet first, example, sending a POST to initiate a message send to selected users.
2. It may be due to errors on my side, but can you confirm that it is possible to host two separate components on a single glassfish instance?


Keep it up! Your projects are life savers and your blog is very informative (videos are very helpful)

Posted: January 18, 2012 13:09 by oneminutedistraction
To answer your Q2, yes, Jabberwocky can support more than 1 instance of component but they have to be 'different' viz. different subdomain.

I don't understand your Q1. Can you give a more detailed example?

BTW if you need presence support, let me know. I've just completed the implementation; trying to find time to blog about it.
Posted: January 18, 2012 13:19 by oneminutedistraction
OK I understand your question now. There are 2 ways of doing this

1. You can do it at the beginning when the component starts up. See this

http://java.net/projects/xmppsupport/sources/source-code-repository/show/playground/customer_query/CustomerQuery/src/java/com/acme/xmpp

Look at Lifecycle.java for the 4 lifecycle events

2. The other way of doing this is to use @Schedule with a stateless session bean. Say you want to fire a message every minute.

@Stateless
public class FireMessage {
@Inject @Named(PredefinedBindings.COMPONENT_MANAGE) ComponentManager mgr;
@Inject @Named(PredefinedBindings.COMPONENT) Component comp;

@Scheduled(hour="*", minute"*/1")
public void firePacket() {
//Fire your message here
}
}

See Timer service tutorial here http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html

Disclaimer: code written off the top of my head. Does not guarantee to compile or correct Wink just illustrating a concept.

HTH
showing 1 - 8 of 8
Replies: 7 - Last Post: January 18, 2012 13:19
by: oneminutedistraction
« Older Topic » Newer Topic
 
 
Close
loading
Please Confirm
Close