Today I spent some time researching the final selections from the Fall 2008 TV Schedule. Drum roll please....... The following shows will be appearing on my family's DVR starting 9/3 with a few shows coming later..
Network, Name, Time and Premier Date
Monday
--------------
CBS Big Bang Theory 8pm 9/22
NBC Chuck 8pm 9/29
CBS Two and a Half Men 9pm 9/22
NBC Heroes 9pm 9/22
ABC Samantha Who? 9:30pm 10/6
Tuesday
---------------
ABC Opportunity Knocks 8pm 9/23
Fox House 8pm 9/16 (9pm)
CBS The Mentalist 9pm 9/23
CBS Without a Trace 10pm 9/23
Wednesday
-----------------
FOX Bones 8pm 9/3
Fox Til Death 9pm 9/10
Fox Do Not Disturb 9:30pm 9/10
Thursday
------------------
NBC The Office 9:00pm 9/25
Friday
--------------------
CBS Numbers 10pm 10/3
NBC Crusoe 8pm 10/17
Sunday
---------------------
CBS Amazing Race 8pm 9/28
ABC Desperate Housewives 9pm 9/28
I hope this inspires you to go program your DVR right NOW!
Sunday, August 31, 2008
Saturday, August 30, 2008
JBoss Messaging
After a few hours of playing with JBoss messaging I have decided that it is a pretty decent product for Open Source developers and companies try to save money. JBoss provides all of the needed JMS features at no cost. Basically my test was to create a JMS server on an existing Ubuntu Linux server I have and use a couple of java clients I wrote to both write and read to the queue from my Apple MacBook Pro. I was able to designate the messages as "Persistent" and even restart the Java JMS provider without loosing the messages. I plan on using this in my next messaging project. If your interested I highly recommend checking it out at JBoss's WebSite. One important note that would have helped me to begin with, you must install a JBoss Application Server as a "Base" foundation for the messaging engine to run in. The following example code will simply take the queue name from the command line.
You will need the following JAR files to establish the connection to the queue:
jbossall-client.jar
jboss-aop-jdk50.jar
jboss-messaging-client.jar
javassist.jar
trove.jar
log4j.jar
Here is the example publish client:
And here is the consumer client:
You will need the following JAR files to establish the connection to the queue:
jbossall-client.jar
jboss-aop-jdk50.jar
jboss-messaging-client.jar
javassist.jar
trove.jar
log4j.jar
Here is the example publish client:
/**
*
*/
package com.thewoodiefamily.jms;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import java.util.Properties;
import javax.naming.InitialContext;
import org.apache.log4j.Logger;
/**
* @author kwoodie
*
*/
public class JMSSender {
static Logger logger = Logger.getLogger(JMSSender.class);
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
env.put(Context.PROVIDER_URL, "harry:1099");
InitialContext remoteCtx = new InitialContext(env);
String destinationName = "/queue/" + args[0];
Queue queue = (Queue)remoteCtx.lookup(destinationName);
logger.info("Queue " + destinationName + " exists");
ConnectionFactory cf = (ConnectionFactory) remoteCtx.lookup("ConnectionFactory");
Connection connection = null;
try
{
connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer sender = session.createProducer(queue);
TextMessage message = session.createTextMessage("Hello!" + Math.random());
message.setJMSExpiration(0);
message.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
connection.start();
sender.send(message);
System.out.println("The " + message.getText() + " message was successfully sent to the " + queue.getQueueName() + " queue");
}
finally
{
if (connection != null)
{
connection.close();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
And here is the consumer client:
/**
*
*/
package com.thewoodiefamily.jms;
import javax.jms.QueueConnection;
import javax.jms.QueueReceiver;
import javax.jms.QueueConnectionFactory;
import javax.jms.MessageConsumer;
import javax.jms.Queue;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.naming.Context;
import java.util.Properties;
import javax.naming.InitialContext;
import org.apache.log4j.Logger;
/**
* @author kwoodie
*
*/
public class JMSConsumer {
static final Logger logger = Logger.getLogger(JMSConsumer.class);
public static class ExListener implements MessageListener
{
public void onMessage(Message msg)
{
TextMessage tm = (TextMessage) msg;
try {
logger.info("onMessage, recv text=" + tm.getText());
} catch(Throwable t) {
t.printStackTrace();
}
}
};
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
QueueConnection connection = null;
try {
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
env.put(Context.PROVIDER_URL, "harry:1099");
InitialContext remoteCtx = new InitialContext(env);
String queueName = "/queue/" + args[0];
Queue queue = (Queue)remoteCtx.lookup(queueName);
logger.info("Queue " + queueName + " exists");
QueueConnectionFactory cf = (QueueConnectionFactory) remoteCtx.lookup("ConnectionFactory");
connection = cf.createQueueConnection();
connection.start();
QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
QueueReceiver consumer = session.createReceiver(queue);
consumer.setMessageListener(new ExListener());
while(true) {
Thread.sleep(5000);
System.out.println("waiting");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Subscribe to:
Posts (Atom)
