Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] How to create a new channel

Thanks again Scott.
But, how I connect at a xmpp server? I will use google accounts to connect in my plugin.
The create channel form are correct?
Thanks
Lucas Scotta

2010/9/29 Scott Lewis <slewis@xxxxxxxxxxxxx>
Lucas,

It seems from the exception trace you give that your xmpp container is not connected (i.e. you haven't connected it to an xmpp server)...so it fails when trying to send (any) message.

...

Caused by: java.net.ConnectException: not connected
    at org.eclipse.ecf.provider.generic.ClientSOContainer.checkConnected(ClientSOContainer.java:509)

Hope this helps,

Scott



On 9/28/2010 6:04 PM, Lucas Augusto Scotta Merlo wrote:
Hi Scott, thank you to the reply.
Good night for everybody.
I tryed to create a new channel how you said.
But I could not. Below I present the steps I did. Can anyone help me?
Thanks.

  • First, I create a channel:
  public IChannelListener presenceChannelListener = null;
    public IChannel channelLock;

    public IChannel createChannelLock() throws ECFException {
        ID channelID = IDFactory.getDefault().createStringID("conclID");

        IContainer presenceContainer = null;
        try {
            presenceContainer = ContainerFactory.getDefault().createContainer("ecf.xmpp.smack");
            IChannelContainerAdapter channelcontainer = (IChannelContainerAdapter) presenceContainer.getAdapter(IChannelContainerAdapter.class);
            presenceChannelListener = new IChannelListener() {

                public void handleChannelEvent(IChannelEvent event) {
                    System.out.println("handleChannelEvent(evt="   event   ")");
                }
            };
            if (channelcontainer != null) {
                channelcontainer.createChannel(channelID, presenceChannelListener, new HashMap());
                channelLock = channelcontainer.getChannel(channelID);
            } else {
                System.out.println("Problem. Channel has not done");
            }
            return channelLock;
        } catch (ECFException e) {
            e.getMessage().toString();
 
            throw new ECFException(e);
        }
    }
    public IChannel getLockChannel() {
        return channelLock;
    }

   
  •     Second, in a different class I use:
    IChannel channel = DocShare.docshare.getLockChannel();
channel.setListener(DocShare.docshare.presenceChannelListener);
channel.sendMessage(DocShare.getOtherID(), msg.serialize());


  • And finally a problem:
org.eclipse.ecf.core.util.ECFException: send message exception
    at org.eclipse.ecf.provider.datashare.BaseChannel.sendMessage(BaseChannel.java:229)
    at br.ufes.lprm.concl.consistency.control.lock.EstruturaLock.Lock(EstruturaLock.java:46) // my class one a use the channel
    at br.ufes.lprm.concl.awareness.outline.OutlineConclListener.actionPerformed(OutlineConclListener.java:60) // another class that is one GUI to the lock
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.net.ConnectException: not connected
    at org.eclipse.ecf.provider.generic.ClientSOContainer.checkConnected(ClientSOContainer.java:509)
    at org.eclipse.ecf.provider.generic.ClientSOContainer.sendMessage(ClientSOContainer.java:426)
    at org.eclipse.ecf.provider.generic.SOContext.sendMessage(SOContext.java:230)
    at org.eclipse.ecf.provider.datashare.BaseChannel.sendMessage(BaseChannel.java:227)
    ... 29 more

   

Lucas Scotta


2010/9/16 Scott Lewis <slewis@xxxxxxxxxxxxx>
Hi Lucas,


On 9/15/2010 12:16 PM, Lucas Augusto Scotta Merlo wrote:
Hello everybody.
I'm finishing a project for my theses's: one extension of ECF for NCL(language of Brazilian Digital TV). In mine extension we include a lock feature (lock) on the elements. To do this we create a message type specifies to be treated on the other side. Then this message's lock is sent to other user by channel.sendMessage(DocShare.getOtherID(), msg.serializeMsgLock());
To obtain the channel, we create a "static object DocShare docShareNCL at DocShare class, then we use in other class: DocShare.docshare.getChannel();
Yet the message is not being treated across the OT and only by our methods of blocking. We use the same listener for OT e lock;
We can have only one listener per channel? How I create one new channel?
So thanks.

Although this sounds fascinating, I don't quite understand what you are trying to accomplish and so it's not immediately clear to me what mechanism you need here...e.g.  would you like to use the *existing* DocShare channel to send your own message (so that the delivery order of your message relative to other docshare messages) is consistent (because channels are sender ordered...i.e. the order that the messages on a given channel are received is the same as the order that they are sent.  This is only true for a single channel...if messages are sent on different channels then the delivery order is not guaranteed.

So by modifying the code that uses the DocShare created channel you can insert your own message in the docshare/OT message stream...or you can create/use a separate channel, but the delivery order of your message on this second channel will not be related to the order of messages received on the DocShare channel.  If you do want a second asynchronous channel, you can create a second channel by using the IChannelContainerAdapter.createChannel(...).  The DocShare code does this to create/setup it's channel.

Also...it would be great if you would describe your thesis work a little further on this list...and if you wish it might be good for you to get involved with the current effort on the creation of a wave provider (which also uses operational transformation)...i.e. see [1].

Thanks,

Scott

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=280347



Lucas Scotta

---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Lucas Augusto Scotta Merlo
MSc in Computer - UFES
http://www.inf.ufes.br/~scotta/
_______________________________________________ ecf-dev mailing list ecf-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ecf-dev


_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev


_______________________________________________ ecf-dev mailing list ecf-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ecf-dev


_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top