Skip to content

Instantly share code, notes, and snippets.

@chrismay
Created November 9, 2009 21:42
Show Gist options
  • Save chrismay/230295 to your computer and use it in GitHub Desktop.
Save chrismay/230295 to your computer and use it in GitHub Desktop.
package com.yaymedia.openvue;
import java.util.Collections;
import java.util.List;
import com.wowza.wms.amf.AMFDataList;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.ModuleBase;
import com.wowza.wms.request.RequestFunction;
import com.yaymedia.openvue.domain.CompositeWhiteboardEventListener;
import com.yaymedia.openvue.domain.Whiteboard;
import com.yaymedia.openvue.domain.WhiteboardEventListener;
import com.yaymedia.openvue.domain.WhiteboardImpl;
import com.yaymedia.openvue.view.RSOWhiteboardListener;
import com.yaymedia.openvue.view.ShapeBinder;
public class WhiteboardModule extends ModuleBase{
private Whiteboard whiteboard;
private ShapeBinder binder = new ShapeBinder();
public WhiteboardModule() {
getLogger().info("WhiteboardModule constructed " + this.hashCode());
}
public void onAppStart(IApplicationInstance instance) {
getLogger().info("onAppStart");
List<? extends WhiteboardEventListener> listeners =
Collections.singletonList(new RSOWhiteboardListener(instance.getSharedObjects()));
WhiteboardEventListener l = new CompositeWhiteboardEventListener(listeners);
whiteboard = new WhiteboardImpl(l);
}
public void onCreateShape(IClient client, RequestFunction function,AMFDataList params) {
whiteboard.addShape(binder.getShape(params));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment