![]() |
|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Possible to get all implementations of a interface?
Is it possibly to get all currently available implementations of a given interface?
I am new to the interface coding and have been reading up and I was curious if it was possible for me to get a list of any classes that are currently implementing my interface? Surely there is and I am just missing it. TIA plucky |
#2
|
|||
|
|||
Looking at Sean's interface classes it appears new ones are added to his via a property so it appears it can't be grabbed automatically if I am correct in my thinking.
|
#3
|
||||
|
||||
What do you mean by "all currently available implementations"? Currently loaded classes? Class definitions in JAR files on the classpath? Plugins available for download?
It's possible to enumerate the currently enabled plugins and check each one to see if it implements a particular interface. This is how my Studio Framework finds Studio plugins. It's also possible to enumerate JARs on the classpath looking for classes that implement a particular interface. This is how my framework used to do it prior to V7. Beyond that you're going to have to define what you're trying to do more precisely in order to know whether it's practical.
__________________
-- Greg |
#4
|
||||
|
||||
Quote:
But as greg noted, it is possible to load every single class in the system, and then test if that class implements the specififed interface. While this is OK for some cases (ie, greg does this in his studio plugins i think), I don't recommend doing this for core code, since you'd actually load every class into memory. Many jars on the system rarely use all classes in the jar, so you'd be loading each class needlessly, and consuming extra memory.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
|||
|
|||
Quote:
Hopefully I explained it better that time. Sean, I am probably misreading but I am refering to this part of your fanart code api from phoenix. Quote:
|
#6
|
||||
|
||||
Plucky, that property may not do anything at the moment... ie, it's always going to be PhoenixFanartSupport. If you want to provide your own Fanart Support class, then I can work with you to provide a pluggable way for you to register your class implementation. Keep in mind, if you are looking to register your own Fanart Support class, then that class is used to "resolve" fanart on the local filesystem. So a reason to provide an implementation would be if you wanted code that use the phoenix apis to load their local fanart from another area, other than the phoenix fanart folder structure.
Perhaps if you outlined what you are trying to do, I could maybe help with some ideas... also, if you are looking at integrating with phoenix apis, then I can certainly help with that. If you are looking at registering your own providers, etc, then I can look at making that more user friendly from a developer perspective, but I need to know exactly what you are trying to do.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#7
|
|||
|
|||
Quote:
![]() ![]() I am trying to allow others to write implementation to SMM and let me pick up there classes and offer them as options automatically (if that makes since completely) |
#8
|
||||
|
||||
Quote:
This is exactly what my Studio Framework does to find Studio plugins. If you have the Framework installed, you have the source code for it. Look at CospGetEnabled in Hook.java to see how I do it.
__________________
-- Greg |
#9
|
|||
|
|||
Quote:
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Interface changes in 6.5.11 | baudfather | SageTV Beta Test Software | 1 | 03-11-2009 04:45 AM |
New SageTV Interface | matrix35 | SageTV Software | 183 | 12-08-2007 02:51 AM |
Future SageTV Implementations? | cmaffia | SageTV Software | 1 | 06-28-2004 10:54 AM |
Interface Design CD | videogeek | SageTV Customizations | 0 | 06-06-2004 12:19 PM |