|
SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Sage API RMI Server
I just wanted to say that I have SageTV 4 running on my PVR350 based machine and all the old EOF problems have gone away. Yea! That being said, I also now wanted to start working with Studio and the Sage API.
To become familiar with the API and avoid lots of reloads in the process, I created a small RMI (Remote Method Invocation) server that is loaded at SageTV startup that wraps the sage api method. This allows me to access all the sage internal functionality from external programs, just as though they were running within the SageTV context. I think this could also open doors for a lot of interesting add on applications. I'd like the Sage folks to comment if this any sort of license violation and whether there is any interest from others before I go ahead and make it more bullet proof. Mike |
#2
|
||||
|
||||
Quote:
[Update] In fact, a little Spring wrapper would make it perfect. |
#3
|
||||
|
||||
This looks interesting to me, also!
avajrd, would you mind posting a simple usage scenario for those of us that are new to Studio, etc.? Thanks! -PGPfan |
#4
|
|||
|
|||
Quote:
Right now, as I understand it, to use the api, a program must be created and loaded by SageTV. This can be done with STV, STVi, or the load_at_startup_runnable_classes in sage.properties. All the functionality of the new feature or application runs within the Java VM that is running SageTV. The api server would simply expose the method "Object api( String api, Object[] args )" to external programs. The simple usage scenario would be: 1. Ensure that rmiregistry is running. This is included with the JRE. 2. Load the server using the load_at_startup_runnable_classes as mentioned above. 3. From an external program, lookup the remote class in the registry and then make calls to it. The external app could be another Java GUI, a web server, email client, etc. I suppose you could even wrap that so that a VB, C, or Python program could access it. Of course there are some security issues that have to be addressed and I'm looking into those right now. Does that make any sense? Mike |
#5
|
|||
|
|||
Quote:
What do you have in mind? Mike |
#6
|
||||
|
||||
Quote:
__________________
Jeffrey Kardatzke Founder of SageTV |
#7
|
||||
|
||||
Quote:
Favorite favorite = XmlBeanFactory.getBean("favorite"); favorite = favorite.getFavorite(10); List airings = new ArrayList(); if (favorite != null) { airings = favorite.getAirings(favorite); } // Display favorites somehow Now, with an RMI, we all just use the interface. Should someone wish to not use the RMI server, the just use a different implementation and use Spring to point to the non RMI impl. |
#8
|
|||
|
|||
OK, finally got my account straightened out avajrd == drjava
Well my simple RMI server turns out to be not so simple. The base sage classes like Channel are not serializable. RMI requires classes to implement java.io.Serializable. So I guess if I want to progress, I have more work to do to encapsulate the functionality of these classes in classes that do implement java.io.Serializable. I'll poke around at it a bit, but I'm not sure what the scope is going to be. I have a feeling that the rmi api is going to take on a more custom feel. Any ideas or suggestions? Mike |
#9
|
||||
|
||||
Quote:
Have an interface called SageChannel which extends Serializable with an AbstractSageChannelImp(just example names). AbstractSageChannelImpl implements SageChannel with methods analogous to Sage's Channel class. A user of the RMI Server would use the SageChannel interface by extending the AbstractSageChannelImpl. So, CustomChannelImpl would extend AbstractSageChannelImpl and the SageChannel interface would be passed into the RMI Server which would import Sage's library and translate the calls into Sage itself. I do a variation of this at work. All my objects are serializable becase they ultimately implement an interface that extends Serializable. |
#10
|
|||
|
|||
Quote:
I think I have the basic mechanics working that have an embedded web based class server along with the rmi server binding. I might need some help with coming up with a sane java.policy file and its customization tools. Mike |
#11
|
||||
|
||||
Quote:
|
#12
|
|||
|
|||
Quote:
Mike |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|