Using PortControl Interface problem????

I am trying to write a program that captures video from my TV tuner composite port , using the following code:
import java.awt.Component;
import java.awt.Frame;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.CannotRealizeException;
import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.NoDataSourceException;
import javax.media.NoPlayerException;
import javax.media.Player;
import javax.media.control.PortControl;
import javax.media.protocol.DataSource;
import javax.swing.JOptionPane;
* @author Zaid
public class Crap {
    public static void main(String args[])
        Player player;
        Frame frame = new Frame("Test");
      try {
            JOptionPane.showMessageDialog(null, "begin the device capturing");
            MediaLocator ml = new MediaLocator("vfw://0");
            if(ml == null)
                JOptionPane.showMessageDialog(null, "No MediaLocator created");
            else
                JOptionPane.showMessageDialog(frame, ml.toString());
            DataSource ds = Manager.createDataSource(ml);
            // getting the port Control
            Object[] c_list = ds.getControls();
            for(int i=0; i<c_list.length; i++)
                JOptionPane.showMessageDialog(frame, c_list.toString());
try {
player = Manager.createRealizedPlayer(ds);
JOptionPane.showMessageDialog(null, "player created successfully");
if (player.getVisualComponent() != null) {
frame.add(player.getVisualComponent());
player.getVisualComponent().setSize(300, 300);
if (player.getControlPanelComponent() != null) {
frame.add(player.getControlPanelComponent());
if (player.getControl("javax.media.control.PortControl")!= null) {
PortControl pc = (PortControl) ds.getControl("javax.media.control.PortControl");
pc.setPorts(PortControl.COMPOSITE_VIDEO);
JOptionPane.showMessageDialog(null, "PortControl Found");
frame.add(player.getControl("PortControl").getControlComponent());
else
JOptionPane.showMessageDialog(frame, "PortControl not found!!!");
player.start();
//audioPlayer.start();
frame.setVisible(true);
frame.setSize(300, 300);
} catch (CannotRealizeException ex) {
Logger.getLogger(JMFtest.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(JMFtest.class.getName()).log(Level.SEVERE, null, ex);
} catch (NoPlayerException ex) {
Logger.getLogger(JMFtest.class.getName()).log(Level.SEVERE, null, ex);
} catch (NoDataSourceException ex) {
Logger.getLogger(Crap.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(frame, "No DataSource found");
} catch (IOException ioe) {
System.out.println("Damn exception: " + ioe);
but PortControl always give that value of null
the reason is  PortControl Interface is not implemented in the JMF
How to implement it ???
Is there any other way to capture TV tuner video from composite port???
Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

xinixmayur, please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
I'm locking this thread now.
db

Similar Messages

  • Using empty interface -- is there a better way to do this?

    Hi,
    I have a set of classes in different projects that I'd like to be referenced together, although they have different methods depending on which project they're from. To do so, I've created an empty interface for each of these classes to implement, so I can return a similar type and then cast it however I need to based on which project I'm using.
    However, I feel the approach of creating an empty interface just isn't the best way to do this. I've looked into annotations, but I don't think they can solve my problem. I don't think I'm being too clear here, so let me give a brief example:
    Here is one of the interfaces I use:
    public interface IceClient {
         public IceOperations operations();
    }Here is the empty interface:
    public interface IceOperations {
    }I have a method which will return a type of IceOperations:
         public static synchronized IceOperations getOperations(String clientName) {
              if (clientMap.containsKey(clientName)) {
                   IceClient client = clientMap.get(clientName);
                   return client.operations();
              } else {
                   System.out.println("No client of that name is currently running.");
                   return null;
         }This is all fine and dandy. I need to instantiate a new IceOperations object in my client code as such, where operations is of type IceOperations:
    operations = new DiagOperations();And finally return it like this, where client.operations() returns a type of IceOperations:
         public DiagOperations operations() {
              return (DiagOperations)client.operations();
         }Anyway I hope that wasn't too confusing. I cannot think of a different way to do this. Is there some way I can do this with annotations? The only other thing I can think of is just returning Object, but that seems ... icky.
    If I need to be clearer, please let me know.
    Thanks

    JoachimSauer wrote:
    I didn't understand them to be trick questions, but rather serious invitations to question and verify your assumptions.
    It might be the fact that every current implementation implements Runnable for some reason (possibly because it starts a Thread on its own). But it's entirely possible that you can produce a completely different implementation that doesn't need the Runnable interface and still be conformant.
    If every implementation of X needs to implement Runnable, then it could be a sign of a slight design smell. Could you give an example where you think it's necessary?Every implementation of my "X" interface is basically a class that acts as a communicator/listener of sorts until it's stopped by the user, similar to a server socket. Sometimes, it has to sit there and wait for events, in which case it obviously must be in its own Thread. Other times it doesn't have to do this; however if I do not start it in its own Thread, I will have to continually stop and restart the communication to invoke operations on the server, which is inefficient.

  • Interface Problems in Yosemite

    Problem shows up when using software other than the native OS X apps.
    If I attempt to close a window behind the app that has focus by clicking the red x part of the semaphore buttons (top left on every window) it will not work unless I change focus to that app by clicking the bar at the top.
    As an example if I'm using Byword to view a document while composing an email in Airmail once I finished and move on to viewing, say a receipt, in Airmail and want to make a copy of that receipt and place it on the desktop. I'm done with Byword and it is covering the desktop so why not close it and get it out of the way. I move the mouse pointer over the red X part of the semaphore buttons and click, nothing happens. I have to bring Byword into focus by clicking the title bar, then click the red x to finally close the window. If the app below Airmail happened to be Safari the red X works properly.
    On my Mac Mini using Yosemite this works properly for all apps.
    This is only a slight problem but I have been having the odd quirky interface problems for the past while and I'm worried that something has gone south and these may end up adding together to make a very large problem.  Initially I had problems with PopClip which seemed to be screwing around with the interface buttons in Rapidweaver 6. I removed the app to clear that problem using AppDelete.
    While trying to diagnose this problem I have removed all the auto login apps that I can and rebooted several times to no avail.
    Any help would be greatly appreciated!
    EtreCheck version: 2.1.8 (121) log:
    EtreCheck version: 2.1.8 (121)
    Report generated February 5, 2015 at 12:32:53 PM EST
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        iMac (27-inch, Late 2012) (Technical Specifications)
        iMac - model: iMac13,2
        1 3.4 GHz Intel Core i7 CPU: 4-core
        8 GB RAM Upgradeable
            BANK 0/DIMM0
                4 GB DDR3 1600 MHz ok
            BANK 1/DIMM0
                4 GB DDR3 1600 MHz ok
            BANK 0/DIMM1
                Empty 
            BANK 1/DIMM1
                Empty 
        Bluetooth: Good - Handoff/Airdrop2 supported
        Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
        NVIDIA GeForce GTX 680MX - VRAM: 2048 MB
            iMac 2048 x 1152
    System Software: ℹ️
        OS X 10.10.2 (14C109) - Time since boot: 0:0:46
    Disk Information: ℹ️
        APPLE HDD WDC WD10EALX-408EA0 disk1 : (1 TB)
            EFI (disk1s1) <not mounted> : 210 MB
            Recovery HD (disk1s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk2) / : 1.11 TB (263.43 GB free)
                Core Storage: disk0s2 120.99 GB Online
                Core Storage: disk1s2 999.35 GB Online
        APPLE SSD SM128E disk0 : (121.33 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            Boot OS X (disk0s3) <not mounted> : 134 MB
            Macintosh HD (disk2) / : 1.11 TB (263.43 GB free)
                Core Storage: disk0s2 120.99 GB Online
                Core Storage: disk1s2 999.35 GB Online
    USB Information: ℹ️
        Verbatim Portable USB 3.0 Drive 1 TB
            EFI (disk3s1) <not mounted> : 210 MB
            Verbatim HD (disk3s2) /Volumes/Verbatim HD : 999.86 GB (31.06 GB free)
        Apple Inc. FaceTime HD Camera (Built-in)
        Logitech USB Receiver
        Samsung Electronics Co., Ltd. ML-2160 Series
        Wacom Co.,Ltd. Wacom Wireless Receiver
        Razer Razer 1600dpi Mouse
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Applications/Transmit.app
        [not loaded]    com.panic.TransmitDisk.transmitdiskfs (4.0.0 - SDK 10.6) [Click for support]
            /Applications/VMware Fusion.app
        [not loaded]    com.vmware.kext.vmci (90.6.3) [Click for support]
        [not loaded]    com.vmware.kext.vmioplug.14.1.3 (14.1.3) [Click for support]
        [not loaded]    com.vmware.kext.vmnet (0231.47.74) [Click for support]
        [not loaded]    com.vmware.kext.vmx86 (0231.47.74) [Click for support]
        [not loaded]    com.vmware.kext.vsockets (90.6.0) [Click for support]
            /Library/Extensions
        [loaded]    at.obdev.nke.LittleSnitch (4234 - SDK 10.8) [Click for support]
        [loaded]    com.avatron.AVExFramebuffer (1.7 - SDK 10.9) [Click for support]
        [loaded]    com.avatron.AVExVideo (1.7 - SDK 10.9) [Click for support]
        [loaded]    com.globaldelight.driver.Boom2Device (1.1 - SDK 10.10) [Click for support]
        [loaded]    com.logitech.manager.kernel.driver (4.10.1 - SDK 10.8) [Click for support]
        [loaded]    com.sophos.kext.sav (9.2.50 - SDK 10.8) [Click for support]
        [loaded]    com.sophos.nke.swi (9.2.50 - SDK 10.8) [Click for support]
        [not loaded]    com.wacom.kext.ftdi (1 - SDK 10.9) [Click for support]
            /System/Library/Extensions
        [loaded]    com.Logitech.Control Center.HID Driver (3.7.0 - SDK 10.6) [Click for support]
        [loaded]    com.Logitech.Unifying.HID Driver (1.3.0 - SDK 10.6) [Click for support]
        [loaded]    com.eltima.SyncMate.kext (0.2.5b15) [Click for support]
        [loaded]    com.globaldelight.driver.BoomDevice (1.1 - SDK 10.1) [Click for support]
        [loaded]    com.splashtop.driver.SRXDisplayCard (1.6 - SDK 10.7) [Click for support]
        [not loaded]    com.splashtop.driver.SRXFrameBufferConnector (1.6 - SDK 10.7) [Click for support]
        [not loaded]    com.wacom.kext.wacomtablet (6.3.10 - SDK 10.9) [Click for support]
            /System/Library/Extensions/Soundflower.kext
        [not loaded]    com.Cycling74.driver.Soundflower (1.6.6 - SDK 10.6) [Click for support]
    Launch Agents: ℹ️
        [running]    at.obdev.LittleSnitchUIAgent.plist [Click for support]
        [not loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [running]    com.Logitech.Control Center.Daemon.plist [Click for support]
        [running]    com.logitech.manager.daemon.plist [Click for support]
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
        [running]    com.realvnc.vncserver.peruser.plist [Click for support]
        [not loaded]    com.realvnc.vncserver.prelogin.plist [Click for support]
        [running]    com.sophos.uiserver.plist [Click for support]
        [running]    com.wacom.wacomtablet.plist [Click for support]
    Launch Daemons: ℹ️
        [running]    at.obdev.littlesnitchd.plist [Click for support]
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [running]    com.backblaze.bzserv.plist [Click for support]
        [loaded]    com.barebones.authd.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
        [running]    com.realvnc.vncserver.plist [Click for support]
        [loaded]    com.rogueamoeba.instanton-agent.plist [Click for support]
        [loaded]    com.sharpcast.xfsmond.plist [Click for support]
        [loaded]    com.sheepsystems.CocoaPrivilegedHelper.plist [Click for support]
        [running]    com.sophos.common.servicemanager.plist [Click for support]
        [loaded]    de.appgineers.Mountain.Helper.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [running]    com.backblaze.bzbmenu.plist [Click for support]
        [running]    com.ecamm.printopia.plist [Click for support]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [loaded]    com.pia.pia_manager.plist [Click for support]
        [loaded]    com.sheepsystems.BookMacster.3EAE0703-42...plist [Click for support]
        [loaded]    com.sheepsystems.BookMacster.3EAE0703-42...plist [Click for support]
        [loaded]    com.valvesoftware.steamclean.plist [Click for support]
        [failed]    ws.agile.1PasswordAgent.plist [Click for support] [Click for details]
    User Login Items: ℹ️
        WD Quick View    Application  (/Library/Application Support/WDSmartware/WDQuickView.app)
    Internet Plug-ins: ℹ️
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        Flash Player: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        WacomNetscape: Version: 2.1.0-1 - SDK 10.8 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        GarminGpsControl: Version: 4.0.2.6 Beta - SDK 10.6 [Click for support]
        WacomTabletPlugin: Version: WacomTabletPlugin 2.1.0.6 - SDK 10.9 [Click for support]
        JavaAppletPlugin: Version: Java 8 Update 31 Check version
    User internet Plug-ins: ℹ️
        Picasa: Version: 1.0 - SDK 10.6 [Click for support]
    Safari Extensions: ℹ️
        1Password
        Clip to DEVONthink
        Choosy
        Ember
        Save to Pocket
        Stache
    3rd Party Preference Panes: ℹ️
        AirServer Preferences  [Click for support]
        Backblaze Backup  [Click for support]
        Choosy  [Click for support]
        Flash Player  [Click for support]
        FUSE for OS X (OSXFUSE)  [Click for support]
        Hazel  [Click for support]
        Java  [Click for support]
        Logitech Control Center  [Click for support]
        Logi Preference Manager  [Click for support]
        Printopia  [Click for support]
        WacomTablet  [Click for support]
        WDQuickView  [Click for support]
        Web Sharing  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 1.11 TB Disk used: 848.39 GB
        Destinations:
            Verbatim HD [Local]
            Total size: 999.86 GB
            Total number of backups: 101
            Oldest backup: 2013-11-22 16:26:50 +0000
            Last backup: 2015-02-05 15:55:38 +0000
            Size of backup disk: Too small
                Backup size 999.86 GB < (Disk used 848.39 GB X 3)
    Top Processes by CPU: ℹ️
            12%    mds
             2%    WindowServer
             0%    loginwindow
             0%    fontd
             0%    mds_stores
    Top Processes by Memory: ℹ️
        292 MB    mds_stores
        172 MB    SophosScanD
        172 MB    InterCheck
        155 MB    SophosAntiVirus
        120 MB    Finder
    Virtual Memory Information: ℹ️
        3.32 GB    Free RAM
        2.72 GB    Active RAM
        1.40 GB    Inactive RAM
        1.15 GB    Wired RAM
        1.56 GB    Page-ins
        0 B    Page-outs
    Diagnostics Information: ℹ️
        Feb 5, 2015, 12:30:03 PM    Self test - passed
        Feb 4, 2015, 10:59:58 PM    /Library/Logs/DiagnosticReports/RapidWeaver 6_2015-02-04-225958_[redacted].cpu_resource.diag [Click for details]
        Feb 3, 2015, 03:07:17 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/WebKitPluginHost_2015-02-03-15 0717_[redacted].crash
        Feb 3, 2015, 03:02:23 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/WebKitPluginHost_2015-02-03-15 0223_[redacted].crash
        Jan 15, 2015, 08:04:41 PM    /Library/Logs/DiagnosticReports/Kernel_2015-01-15-200441_[redacted].panic [Click for details]

    Try un-installing Sophos.
    Sophos Un-install

  • How to use local interface in my easy code ?

    hi everybody
    I work on an ejb project. My code is like that to test remote interface (and it works) :
    public class TestStudent {
       Properties properties;
       public TestStudent() {
          properties = new Properties();
          properties.put("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
          properties.put("java.naming.factory.url.pkgs",
          "org.jboss.naming:org.jnp.interfaces");
          properties.put("java.naming.provider.url", "jnp://localhost:1099");
          properties.put("jnp.disableDiscovery", "true");
       public static void main(String[] args) {
          TestStudent beanStudent = new TestStudent();
          beanStudent.createBean();
       public void createBean() throws EJBException {
          try {
             InitialContext context = new InitialContext(properties);
             Object object = context.lookup(StudentHome.JNDI_NAME);
             StudentHome studentHome = (StudentHome) PortableRemoteObject.narrow(object,StudentHome.class);
             Student student = studentHome.create();
             student.setName("pirlouit");
             System.out.println(student.getId());
             System.out.println(student.getName());
          } catch (NamingException e) {
             throw new EJBException(e);
          } catch (RemoteException e) {
             throw new EJBException(e);
          } catch (CreateException e) {
             throw new EJBException(e);
    }Then I do quite the same thing to test local interface like in the following code but it doen't work :
    public class TestStudent {
       Properties properties;
       public TestStudent() {
          properties = new Properties();
          properties.put("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
          properties.put("java.naming.factory.url.pkgs",
          "org.jboss.naming:org.jnp.interfaces");
          properties.put("java.naming.provider.url", "jnp://localhost:1099");
          properties.put("jnp.disableDiscovery", "true");
       public static void main(String[] args) {
          TestStudent beanStudent = new TestStudent();
          beanStudent.createBean();
       public void createBean() throws EJBException {
          try {
             InitialContext context = new InitialContext(properties);
             Object object = context.lookup(StudentLocalHome.JNDI_NAME);
             StudentLocalHome studentLocalHome = (StudentLocalHome)object;
             System.out.println("studentLocalHome is null ? "+studentHome.equals(null));
             StudentLocal student = studentLocalHome.create();
             student.setName("pirlouit");
             System.out.println(student.getId());
             System.out.println(student.getName());
          } catch (NamingException e) {
             throw new EJBException(e);
          } /*catch (RemoteException e) {
             throw new EJBException(e);
          }*/ catch (CreateException e) {
             throw new EJBException(e);
    }The print of "student local home is null ?" give me 'true' which is not the answer I want ... so here is the problem. How can I get my entity bean using local interface ?
    For the moment 've got the exception (which appears on instruction "StudentLocal student = studentLocalHome.create();") :
    Exception in thread "main" java.lang.NullPointerException
         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
         at $Proxy0.create(Unknown Source)Please help !! Thank you very much !

    Write a JSP to test Local Interface. You cannot call Local Interface from a remote JVM.
    Jay
    http://www.javarss.com - Java News from around the world.
    Visit JavaRSS.com and add above signature to your messages. Thanks!

  • Is JPA discourages use of interface?

    Hello,
    I am working in J2EE since last 3-4 months. Currently understanding (or i should say it learning) JPA.
    As per my knowledge, JPA does not support use of interface(as a persistent attribute) in entity classes. I tried to get information about it, but in vain. Few people suggested to have a look at EclipseLink, but i am against using any vendor specific features.
    And not using interface is bad practice, right?
    As Erich Gamma said Program to an interface not to an implementation. Now that is not possible with JPA right?
    So,
    Is there any workaround?
    What is your approach?
    Or
    People just accepted it.
    -Nachiket

    N_i_X wrote:
    Hello,
    I am working in J2EE since last 3-4 months. Currently understanding (or i should say it learning) JPA.
    As per my knowledge, JPA does not support use of interface(as a persistent attribute) in entity classes. What state does an interface have that needs to persist? I thought that interfaces were about behavior, not state. If we agree on that, how does it make sense to persist an interface?
    I tried to get information about it, but in vain. Few people suggested to have a look at EclipseLink, but i am against using any vendor specific features.You can use JPA-only features and still stick with EclipseLink as your implementation. You have to choose SOMEBODY'S implementation.
    And not using interface is bad practice, right?Depends. Overuse can be as bad as underuse. The trick is the getting the right usage for your problem. Any persistent class that needs inheritance should be concrete, in which case you have the usual choices for persistence: one table per hierarchy, one table per concrete subclass, etc.
    As Erich Gamma said Program to an interface not to an implementation. Now that is not possible with JPA right?I think it's dangerous to accept statements as dogma.
    Is there any workaround?See above. I think persistent classes need to be concrete. Programming to an interface is very good, but not in the case of a persistent class. Those with persistent state need to be concrete.
    %

  • Unusual use of interface defining static factory class with getInstance

    This question is prompted by a recent New to Java forum question ask about the differences between Interfaces and Abstract classes. Of course one of the standard things mentioned is that interfaces cannot actually implement a method.
    One of my past clients, one of the 500 group, uses interfaces as class factories. The interface defines a pubic static class with a public static method, getInstance, that is called to generate instances of a class that implements the interface.
    This architecture was very object-oriented, made good use of polymorphism and worked very well. But I haven't seen this architecture used anywhere else and it seemed a little convoluted.
    Here is a 'pseudo' version of the basic interface template and use
    -- interface that defines public static factory class and getInstance method
    public interface abc {
        public static class FactoryClass
            public static abc getInstance ()
                return (abc) FactoryGenerator(new abcImpl(), abc.class);
    -- call of interface factory to create an instance
    abc myABC = abc.Factory.getInstance();1. Each main functional area ('abc' in the above) has its own interface factory
    2. Each main functional area has its own implementation class for that interface
    3. There is one generator (FactoryGenerator) that uses the interface class ('abc.class') to determine which implementation class to instantiate and return. The generator class can be configured at startup to control the actual class to return for any given interface.
    I should mention that the people that designed this entire architecture were not novices. They wrote some very sophisticated multi-threaded code that rarely had problems, was high performance and was easy to extend to add new functionality (interfaces and implementing classes) - pretty much plug-n-play with few, if any, side-effects that affected existing modules.
    Is this a best-practices method of designing factory classes and methods? Please provide any comments about the use of an architecture like this.

    Thanks for the feedback.
    >
    I don't see how 'the generator class can be configured at startup to control the actual class to return for any given interface' can possibly be true given this pseudo-code.
    >
    I can see why that isn't clear just from what is posted.
    The way it was explained to me at the time is that the interface uses standard naming conventions and acts like a template to make it easy to clone for new modules: just change 'abc' to 'def' in three places and write a new 'defImpl' class that extends the interface and the new interface and class can just 'plug in' to the framework.
    The new 'defImpl' class established the baseline functionality that must be supported. This line
    return (abc) FactoryGenerator(new abcImpl(), abc.class);uses the initial version of the new class that was defined, 'abcImpl()', when calling the FactoryGenerator and it acted as a 'minimum version supported'. The generator class could use configuration information, if provided, to provide a newer class version that would extend this default class. Their reasoning was that this allowed the framework to use multiple versions of the class as needed when bugs got fixed or new functionality was introduced.
    So the initial objects would be an interface 'abc' and a class 'abcImpl'. Then the next version (bug fixes or enhancements) would be introduced by creating a new class, perhaps 'abcImpl_version2'. A configuration parameter could be passed giving 'abcImpl' as the base class to expect in the FactoryGenerator call and the generator would actually create an instance of 'abcImpl_version2' or any other class that extended 'abcImpl'.
    It certainly go the job done. You could use multiple versions of the class for different environments as you worked new functionality from DEV, TEST, QA and PRODUCTION environments without changing the basic framework.
    I've never seen any Java 'pattern' that looks like that or any pattern where an interface contained a class. It seemed really convoluted to me and seems like the 'versioning' aspect of it could have been accomplished in a more straightforward manner.
    Thanks for the feedback. If you wouldn't mind expanding a bit on one comment you made then I will mark this ANSWERED and put it to rest.
    >
    I don't mind interfaces containing classes per se when necessary
    >
    I have never seen this except at this one site. Would you relate any info about where you have seen or used this or when it might be necessary?

  • Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage -- Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.

    Adobe Reader XI (11.0.08) doesn't create thumbnail (bitmap) using Microsoft Interface IExtractImage --> Extract on Windows Server 2008 R2, when exe to generate thumbnail is launched from Windows service.
    But if exe is launched as standalone, then interface IExtractImage --> Extract, gives Bitmap to generate thumbnail of PDF document.
    Above problem occurs only for PDF documents, if we tried same with other software like CAD -CATIA it works without any problem.
    Is there any security concerns form PDF side, which doesn't allow to generate Bitmaps, if exe to generate it is launched form Windows service.

    It might be deliberate, Acrobat and Reader software is not intended to run in a service environment.

  • To use the interface creating a container

    Hello,
    I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>(); I read the same with other containers too (Map = new HashMap, List = new ArrayList). I don't understand the real importance. Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)
    thanks.

    mickey0 wrote:
    I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>();Just to add to George's good advice, the basic reason is that if you decide later on that your Set is better off as a TreeSet instead of a HashSet, you can simply change the assignement to
    Set<String> set = new TreeSet<String>();indeed, since all your methods will likely be coded to take Sets if you used the above method, you could probably change it to
    NavigableSet<String> set = new TreeSet<String>();without any problems.
    Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)The only method that HashSet has that Set doesn't is 'clone()'. Obviously, when choosing the interface, it should be as close as possible to to the capabilities you need.
    Winston

  • Module Interface Problems

    I'm having a problem passing variables from one module to
    another via an interface.
    I have an application that calls a module when it enters a
    specific state, which works fine. The module is loaded through
    <mx:ModuleLoader id="modMyModule1" url="myModule1.swf"> and
    it works as expected.
    Within this module, I have a button that when pressed, calls
    a second module via a module loader, using an interface. I need an
    interface, as there is a variable that I need to pass between these
    two modules. Clicking the button runs a couple of functions, ending
    with:
    currentState='Results';
    modMyModule2.url='myResults.swf";
    and the states look like:
    <mx:states>
    <mx:State name="Results">
    <mx:AddChild>
    <mx:ModuleLoader id="modMyModule2"
    ready="readyModule(event)" error="modErrorHandler(event)" />
    </mx:AddChild>
    </mx:State>
    </mx:states>
    So when the module is ready, the following code is invoked in
    modMyModule1:
    private function readyModule(evt:ModuleEvent):void
    var ichild:* = modMyModule2.child as IResults;
    if(ichild != null) { ichild.searchResults =
    arrSearchResults; trace("NOT NULL"); }
    else { trace("NULL!"); }
    modMyModule2 contains 'implements="IResults"' in it's root
    module tag, and IResults is defined as follows:
    package
    import flash.events.IEventDispatcher;
    import mx.collections.ArrayCollection;
    public interface IResults extends IEventDispatcher
    function set searchResults(arrResults:ArrayCollection):void;
    function get searchResults():ArrayCollection;
    I have corresponding getter and setter functions in my
    modMyModule2, but they never seem to get called! For some reason,
    the interface is always failing, and therefore in my readyModule()
    function in the first module, it always traces "NULL".
    I can access the required variable in the second module via
    parentApplication.modMyModule1.child.arrSearchResults, but I'd
    prefer to do it via the interface.
    I've gone through all the docs, but I can't see what I've
    done that's different from anything in them, except for the fact
    that I'm calling a module from a module via an interface.
    Can anyone shed some light on this at all?
    Cheers,
    K.

    I don't have a solution to your problem, but I can point you
    somewhere. The documentation team has released the module
    documentation, but I think it is only currently available at their
    blog (as the documentation will be released later).
    http://blogs.adobe.com/flexdoc/
    It should be the first entry of the blog. I noticed that one
    of the data points mentioned inter-module communication, -
    hopefully that is what you are looking for.
    Good Luck,
    Andy

  • Is it recommended that i use an interface for logic 9, if so what brand

    waht kind of interface should i get that is relatively cheap and does a good job, is it recommended that even use an interface, i have electric guitars, and a keyboard, and a mic.

    If its not an entirely different situation with regard to Logic Pro 8/Logic Pro 9, Apogee makes a few interface options at different price ranges. The Duet is a quality interface as their mid range price option. I have had experience running Logic sessions with the Duet and have had relatively few problems. Also, Apogee typically does a good job integrating their specs/design for Logic users.

  • Using component interface in Java

    i know working and programming with component interface but no knowledge about java
    please give me steps to use component interface in java.
    Shiv

    1. Identify/Create Component Interface which you want to access in Java
    2. Apply security for your Component Interface
    3. Open the Component Interface in Application Designer
    4. In Application Designer, select Build > PeopleSoft APIs
    5. A dialog box comes with caption "Build PeopleSoft API Bindings"
    6. Select Build checkbox for Java Classes Frame and give a target directory
    7. Select OK, This will generate PeopleSoft API classes, dont panic if it takes some time
    8. Right click on component interface, select Generate Java Template, this step will generate Java Template
    9. If you are not familiar with compiling and setting up CLASSPATH in Java then it is better you ask any of your colleagues who knows Java.
    10. Once CLASSPATH is set properly you can compile the generate Java Template without any problems
    11.after compilation you will get a .class file and you need to execute that .class file
    12. When you execute the .class file it will ask application server name, application server port, application user name and application password.
    If you give all the information correctly then you will be accessing CI in Java.
    Let me know if you need more help on this.
    Jayaprakash Tedla

  • ClassCastException by using Local Interface of EJB in other, but local EAR

    Hi,
    I get a ClassCastException if I try to cast the EJSWrapper-Class returned from local EJB Lookup to the interface it implements.
    The environment I use is WSADIE 5.1.1 with integrated Testenvironment.
    I have defined two EARs. One with a Web-Application and one wich contains the EJB to call from the WebApp. Both run in the same appserver instance wich means both run in the same JVM and i should be able to use Local Interface of the EJB.
    The EJB should use Libraries from the Server Environment while the WebApp uses newer Libs than the Server Environment offers(eg axis-rpc,wsdl4j,saaj). The Classloader-Policy of the EAR with the WebApp is set to PARENT_LAST while the Classloader-Policy of the EAR with the EJB is set to PARENT_FIRST.
    I do a Lookup by using an EJB-Local-Reference. The returned object is an EJSLocalStatelessHome-Object, wich implements my LocalEJBInterface. But if i try to cast to Object to this interface a ClassCastException occurs.
    The Classes of the EJB are packaged as follows:
    EJBName.jar contains the EJB-Impl class, the Serverside Implementations for RMI/IIOP interaction an EJSWrapper classes. This jar is packaged with the EJB-EAR.
    EJBClient.jar contains the Local- and Remote-Interface classes and the Stub-classes for EJBHome and EJB-Implementation. This jar is packaged wich both EARs, because of the interfaces, wich are needed in both projects.
    The Classloader of the EAR with the WebApp has no access the jar with the EJB-Impl, the generated Ties- and EJSWrapperclasses because it is located in only the EJB-EAR. But the interface-class is contained in the WebApp-EAR as described above.
    The exact Exception is as follows:
    java.lang.ClassCastException: com/ibm/wsrf/EJSLocalStatelessBPEAdapterHome_c2546ef5 incompatible with com/ibm/wsrf/BPEAdapterLocalHome
    java.lang.Throwable.<init>(Throwable.java)
    java.lang.Throwable.<init>(Throwable.java)
    java.lang.ClassCastException.<init>(ClassCastException.java:53)
    org.tempuri.ResourceDiscoveryService.DiscoverySoapHttpBindingImpl.getResourceEPR(DiscoverySoapHttpBindingImpl.java)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
    ... The EJSLocalStatelessBPEAdapterHome_c2546ef5 implements the BPEAdapterLocalHome interface.
    Please, can anyone give me a hint how to solve this problem?
    Thanks in advance, Michael

    Problem solved!
    The different EAR contained each an own copy of the jar with the local and remote interfaces of the EJB. The Problem is caused by the separate classloaders of the EARs in an application server. Each EAR Classloader loads his own version of the interface classes. Is the same class loaded by different classloaders, the JVM handles this classes as different classes. An example if you create an instance of a class in one classloader and try to reference the created instance by the same class from another classloader, the association will fail, because of different classloaders in the same JVM.
    The solution in an application server where you have deployed two projects and want to use local interfaces is, store the interfaces(and only the interfaces) in an directory, where it is found by the parent classloader of the EAR classloaders. Remove the Jar with the interface from the EARs. The EAR Classloaders will then search in the their parent classloader for the interfaces. The interfaces will be loaded by the parent classloader and will recognized as compatible by the JVM.
    Greetings, hope this helps help others!
    Michael

  • Using interdomain interfaces

    Hi all,
    I'm using WLE 5.01 on Solaris and trying (in vain) to
    have one domain (alfa) use services advertised
    from another domain (beta). We've done this before
    between machines but this particular scenario has both
    domains on one machine.
    We are getting an error saying that the related factory
    cannot be found ( the beta domain gateway reports incoming
    requests from the alfa domain so at least we know that
    the communification seems ok )
    Is there anything in particular we need to do to get this
    configuration to work or even anything in particular we should
    be looking at/debugging
    Thanks in advance for any help,
    cheers,
    Paul Power

    hi, when you used Local interface, you should not use PortableRemoteObject.narrow to get the LocalHomeObj. In fact, the Object which was returned by lookup is already is the LocalHomeObj. You can do as that, ie.
    Object objref = initial.lookup("ReiseTermin");
    ReiseTerminLocalHome home = (ReiseTerminLocalHome) objref;
    I have a problem using an stateless Session Bean
    communicating with an Entity Bean through the local
    interface. Both Beans have remote as well as local
    interfaces. What should I do in method lookup()? When
    I give a remote interface as parameter and afterwards
    use the method narrow(), there is a
    ClassCastException:
    InitialContext ic = new InitialContext();
    Object objRef = ic.lookup("ReiseTermin");
    ReiseTerminLocalHome reiseTermin_home =
    e = (ReiseTerminLocalHome)
    PortableRemoteObject.narrow(objRef,ReiseTerminLocalHom
    .class);
    When the local interface is passed through as
    parameter, it cannot be found:
    InitialContext ic = new InitialContext();
    ReiseTerminLocalHome reiseTermin_home =
    (ReiseTerminLocalHome)ic.lookup("ReiseTermin");
    Thanks for any help

  • Interfacing problem

    Dear All gurus/experts,
    I need help from you to solve an interface problem. The problem is how to create interface where I want to implement HR application (java) and SAP B1. I am really confusing to the stepwise I must do in creating interface.Do I must define fields/columns, forms, document or report in the SAP B1 side first and then compare to the HR application fields/columnc/forms/documents/reports. The difference between them then fixed and created if required. The main purpose is all the HR process will be handled by HR Application and the data will be sent to SAP B1. The data directly posted to G/L  for example payroll, expenses relate to HR and also pension. is it possible for me to create a template and then the template update to SAP B1 using Data transfer workbench (DTW) ? the application can be updated the data file into CSV, txt, etc. If you have any experience about that, pls share to me.  I appreciate your answer so much.
    TIA.
    Rgds,

    Tks for your answer. Actually it is interfacing other product or solutions, for example human resource solutions or from microsoft dynamics manufacturing module. is it possible to do that ? I appreciate your answer. TIA
    Rgds,

  • Editing the Customer Address using Open Interface

    Hi All,
    The requirement is to edit the address details(postal codes) of the customer using Open Interface and not the APIs.
    They are insisting on using open interface as the Vertex validation(Taxation rules) is taken care only by Open Interface.
    Will need help on this.Kindly advice.

    Please refer the following whitepaper
    https://metalink2.oracle.com/cgi-bin/cr/getfile.cgi?p_attid=67196.1:1
    Thanks,
    Anil

Maybe you are looking for

  • Backflush error on selection of available stock Batch

    Hi, I got an error in backflush while performing MFBF. I have a material component which is received by two different vendors A and B. I am managing the batch name as vendor code so my batch name is A and B. When I performed MFBF the component to be

  • Backup iTunes playlists on Mac Power PC G4, OS 10.4.11to Lacie Starck external hard drive

    I have a Mac Power PC G4, OS 10.4.11, and have recently bought my first external hard drive, a LaCie Starck. I have my iTunes seperated into convenient playlists: is it just a matter of creating a script for each individual playlist in Intego Backup

  • Mess up with music library on iPhone

    I purchased some albums of David Guetta! It was organized correct! But today, I synced with iTunes and the album songs are completed shuffled! For an example, Nothing But the Beat Ultimate, was a single album before, and now, there are lots of albums

  • INVALID OCR

    Hi, I have 10g R2 single instance with ASM installed and running on AIX 5L. Today after rebooting the box oracle didn't come up. I checked and found that the CSS service is not starting up. I try to start it manually also but it kept failing on me. I

  • CS6 trial download

    How do I download the trial version of CS6 without all the other confusing programs?