Skip to content

Commit

Permalink
added message-producer and message-recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
markoscalderon committed Jun 5, 2010
1 parent 3856231 commit e187597
Show file tree
Hide file tree
Showing 20 changed files with 958 additions and 0 deletions.
63 changes: 63 additions & 0 deletions labs/record-and-playback/message-producer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
usePlugin 'java'
usePlugin 'eclipse'
usePlugin 'war'

version=0.2

task copyToLib(dependsOn: configurations.default.buildArtifacts, type: Copy) {
into('$buildDir/lib')
from configurations.default
from configurations.default.allArtifacts*.file
}
repositories {
mavenCentral()
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = "maven2-central"
addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision])(-[classifier]).[ext]"
addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision])(-[classifier]).[ext]"
}
flatDir(name: 'fileRepo', dirs: "$projectDir/src/main/webapp/WEB-INF/lib")
}
dependencies {
compile('org.apache.activemq:activemq-all:5.2.0') {
artifact { name='activemq-all' ; type='jar' }
}
compile('commons-beanutils:commons-beanutils:1.8.3') {
artifact { name='commons-beanutils' ; type='jar' }
}
compile('commons-collections:commons-collections:3.2') {
artifact { name='commons-collections' ; type='jar' }
}
compile('commons-io:commons-io:1.4') {
artifact { name='commons-io' ; type='jar' }
}
compile('commons-lang:commons-lang:2.5') {
artifact { name='commons-lang' ; type='jar' }
}
compile('commons-logging:commons-logging:1.1.1') {
artifact { name='commons-logging' ; type='jar' }
}
compile('net.sf.ezmorph:ezmorph:1.0.6') {
artifact { name='ezmorph' ; type='jar' }
}
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.3', classifier: 'jdk15'

compile('org.springframework:spring:2.5.6') {
artifact { name='spring' ; type='jar' }
}
compile('org.springframework:spring-jms:2.5.6') {
artifact { name='spring-jms' ; type='jar' }
}
compile('org.apache.tomcat:servlet-api:6.0.26') {
artifact { name='servlet-api' ; type='jar' }
}
compile('xom:xom:1.2.5') {
artifact { name='xom' ; type='jar' }
}
}
uploadArchives {
uploadDescriptor = false
repositories {
add project.repositories.fileRepo
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* BigBlueButton - http://www.bigbluebutton.org
*
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
*/

package org.bbb;

import java.io.Serializable;
/**
*
* @author Marco Calderon <[email protected]>
*/
public class Event implements IEvent,Serializable {

private String conferenceID;
private String uuid;
private String message;

public Event() {
super();
}

public String getConferenceID() {
return this.conferenceID;
}

public String getMessage() {
return this.message;
}

/**
* @param conferenceID the conferenceID to set
*/
public void setConferenceID(String conferenceID) {
this.conferenceID = conferenceID;
}

public void setMessage(String message) {
this.message = message;
}

public String getUUID() {
return this.uuid;
}

public void setUUID(String uuid) {
this.uuid=uuid;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* BigBlueButton - http://www.bigbluebutton.org
*
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
*/

package org.bbb;

/**
*
* @author Marco Calderon <[email protected]>
*/
public interface IEvent extends java.io.Serializable {
public String getConferenceID(); //conferenceid
public void setConferenceID(String conferenceid); //conferenceid
public String getUUID(); // UUID for each message
public void setUUID(String uuid); // UUID for each message
public String getMessage(); //JSON message
public void setMessage(String message); //JSON message
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BigBlueButton - http://www.bigbluebutton.org
*
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
*/

package org.bbb.sender;

import org.bbb.IEvent;


/**
*
* @author Marco Calderon <[email protected]>
*/
public interface IMessageGeneratorSender {
public void sendEvents(IEvent event);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* BigBlueButton - http://www.bigbluebutton.org
*
*
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
*
* BigBlueButton is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
*
*/

package org.bbb.sender;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import org.bbb.IEvent;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;

/**
*
* @author Marco Calderon <[email protected]>
*/
public class MessageGeneratorSender implements IMessageGeneratorSender {
private JmsTemplate jmsTemplate;

public void sendEvents(final IEvent event) {
jmsTemplate.send(new MessageCreator() {

public Message createMessage(Session sn) throws JMSException {
Message msg=sn.createObjectMessage(event);
return msg;
}
});
}

/**
* @return the jmsTemplate
*/
public JmsTemplate getJmsTemplate() {
return jmsTemplate;
}

/**
* @param jmsTemplate the jmsTemplate to set
*/
public void setJmsTemplate(JmsTemplate jmsTemplate) {
this.jmsTemplate = jmsTemplate;
}

}
Loading

0 comments on commit e187597

Please sign in to comment.