Wildcards in the class definition

I have a class which extends java.util.Hashtable. The Key is String and value is a HttpClient object, but in future I can have Values as objects other than HttpClient. I was thinking to use a wildcard for storing the value, but the syntax isn't right. What is the right way to do it? Thanks.
public class MyHashtable<String, ?> extends Hashtable {
   public MyHashtable() {
}This works:
public class MyHashtable<String, HttpClient> extends Hashtable {
   public MyHashtable() {
}

public class MyHashtable<String, ?> extends Hashtablepublic class MyHashtable<String, T> extends Hashtable<String, Object> or possibly
public class MyHashtable extends Hashtable<String, Object>Why do you need this subclass at all?

Similar Messages

  • [svn:fx-trunk] 5819: Fix asdoc issue for event description getting copied over to the class definition .

    Revision: 5819
    Author: [email protected]
    Date: 2009-03-31 13:15:14 -0700 (Tue, 31 Mar 2009)
    Log Message:
    Fix asdoc issue for event description getting copied over to the class definition.
    QE Notes: None.
    Doc Notes: None.
    tests: checkintests, asdoc tests
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    THank you , Nancy. Appreciate the input.
    So instead of this:
    <a class="brand" href="index.html"><img src="../img/logo-ca.png"alt="Consumers Advocate Review"> </a>
    Would it be something like this?:
    <a class="brand" href="index.html"><img src="http://ConsumersAdvocate/img/logo-ca.png"alt="Consumers Advocate Review"> </a>
    And if I do that, is there a way to cope with that locally so that DW can still display the images?
    jeff

  • Best practice to handle the class definitions among storage enabled nodes

    We have a common set of cache servers that are shared among various applications. A common problem that we face upon deployment is with the missing class definition newly introduced by one of the application node. Any practical approach / best practices to address this problem?
    Edited by: Mahesh Kamath on Feb 3, 2010 10:17 PM

    Is it the cache servers themselves or your application servers that are having problems with loading classes?
    In order to dynamically add classes (in our case scripts that compile to Java byte code) we are considering to use a class loader that picks up classes from a coherence cache. I am however not so sure how/if this would work for the cache servers themselves if that is your problem!?
    Anyhow a simplistic cache class loader may look something like this:
    import com.tangosol.net.CacheFactory;
    * This trivial class loader searches a specified Coherence cache for classes to load. The classes are assumed
    * to be stored as arrays of bytes keyed with the "binary name" of the class (com.zzz.xxx).
    * It is probably a good idea to decide on some convention for how binary names are structured when stored in the
    * cache. For example the first tree parts of the binary name (com.scania.xxxx in the example) could be the
    * "application name" and this could be used as by a partitioning strategy to ensure that all classes associated with
    * a specific application are stored in the same partition and this way can be updated atomically by a processor or
    * transaction! This kind of partitioning policy also turns class loading into a "scalable" query since each
    * application will only involve one cache node!
    public class CacheClassLoader extends ClassLoader {
        public static final String DEFAULT_CLASS_CACHE_NAME = "ClassCache";
        private final String classCacheName;
        public CacheClassLoader() {
            this(DEFAULT_CLASS_CACHE_NAME);
        public CacheClassLoader(String classCacheName) {
            this.classCacheName = classCacheName;
        public CacheClassLoader(ClassLoader parent, String classCacheName) {
            super(parent);
            this.classCacheName = classCacheName;
        @Override
        public Class<?> loadClass(String className) throws ClassNotFoundException {
            byte[] bytes = (byte[]) CacheFactory.getCache(classCacheName).get(className);
            return defineClass(className, bytes, 0, bytes.length);
    }And a simple "loader" that put the classes in a JAR file into the cache may look like this:
    * This class loads classes from a JAR-files to a code cache
    public class JarToCacheLoader {
        private final String classCacheName;
        public JarToCacheLoader(String classCacheName) {
            this.classCacheName = classCacheName;
        public JarToCacheLoader() {
            this(CacheClassLoader.DEFAULT_CLASS_CACHE_NAME);
        public void loadClassFiles(String jarFileName) throws IOException {
            JarFile jarFile = new JarFile(jarFileName);
            System.out.println("Cache size = " + CacheFactory.getCache(classCacheName).size());
            for (Enumeration<JarEntry> entries = jarFile.entries(); entries.hasMoreElements();) {
                final JarEntry entry = entries.nextElement();
                if (!entry.isDirectory() && entry.getName().endsWith(".class")) {
                    final InputStream inputStream = jarFile.getInputStream(entry);
                    final long size = entry.getSize();
                    int totalRead = 0;
                    int read = 0;
                    byte[] bytes = new byte[(int) size];
                    do {
                        read = inputStream.read(bytes, totalRead, bytes.length - totalRead);
                        totalRead += read;
                    } while (read > 0);
                    if (totalRead != size)
                        System.out.println(entry.getName() + " failed to load completely, " + size + " ," + read);
                    else
                        System.out.println(entry.getName().replace('/', '.'));
                        CacheFactory.getCache(classCacheName).put(entry.getName() + entry, bytes);
                    inputStream.close();
        public static void main(String[] args) {
            JarToCacheLoader loader = new JarToCacheLoader();
            for (String jarFileName : args)
                try {
                    loader.loadClassFiles(jarFileName);
                } catch (IOException e) {
                    e.printStackTrace();
    }Standard disclaimer - this is prototype code use on your own risk :-)
    /Magnus

  • How to merge 2 lists in java in the class definition

    Hello, please help me. I am totally
    I have been writing a class articleList.
    I need to merge articleList 1 with articleList 2 to get a new list containing all items from articleList 1 and articleList 2, no double items required.
    How can I implement this in the articleList class?
    I have this already
    // this method merges 2 lists together
    public void merge (List a, List b)
    what to put here?
    Please help?

    Create a HashSet and add all items from both liststo
    that set. Do then create a List from that Set.
    KajWhether data redundancy can be solved by HashSet, Kaj?Yes. A set does not allow duplicates. Isn't that what he wanted to do? Remove duplicates from the result?
    Kaj

  • Class Definition & Implementation

    Hi,
      In JAVA or Other OOP languages the class definition & implementation are doing within the same task i.e with in the class only they are defining & implementing.But when it comes to ABAP the definition part & implementation part of a class are divided into 2 tasks. Why they are designed like that?

    Hi Suresh Reddy,
    The main intention behind this design is
    " to differentiate the class definition and implementation clearly ."
    Even if you have a chance to including both  class definition and implementation in same structure, it is difficult to differentiate  these things in lengthy implementation classes.
    Thank you,
    Prasad GVK.

  • Shared class definition memory

    I just received notification that this bug (RFE) have been closed (well solved really)
    http://developer.java.sun.com/developer/bugParade/bugs/4416624.html
    matfud

    I think that it is only the class definitions that are
    shared. Instances of the classs are created
    independently
    by each VM.
    The technique they have chosen should speed up loading
    of system (and perhaps other) classes as
    their files no longer need to be individually opened
    and verified (acutally they may still need to be
    verified).
    Instances of the classes will not be shared though.
    Something will be shared. I suspect it will be the methods primarily. From the explaination in the bug...
    First, a portion of the shared archive, currently between five and six
    megabytes, is mapped read-only and therefore shared among multiple JVM
    processes.

  • What is class definition in RMI

    Hi,
    What exactly is the class definition (mentioned in http://java.sun.com/j2se/1.4.2/docs/guide/rmi/codebase.html: "If the class definition for the stub instance can be found....."
    Is it the interface class or the implementation of the interface class?
    Thanks for answering my (maybe stupid) question.

    Is it the interface classNo
    or the implementation of the interface class?It is the xxx_Stub.class file generated by rmic if and when you run it on a class named xxx.

  • JAXB not generating correct class definition

    Hi,
    I am using JAXB 2.0 and the JAXB plugin for Eclipse 3.x.
    The problem I have is that when I run XJC on my XSD file the class definition for
    a particular class is not what I am expecting. The class only defines 1 get method instead of three. While I am expecting to see getX getY and getZ I am seeing only 1 method getXAndgetYAndgetZ. Here is a snippet of the XSD file:
         <xs:element name="Sql">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="Query"/>
                        <xs:element ref="Table" maxOccurs="unbounded"/>
                        <xs:element name="Database" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>I have defined the Table element in the XSD.
    In this case my generated Sql class has the following method:
    public List<JAXBElement<String>> getQueryAndTableAndDatabase() {
            if (queryAndTableAndDatabase == null) {
                queryAndTableAndDatabase = new ArrayList<JAXBElement<String>>();
            return this.queryAndTableAndDatabase;
        }Is there a problem with my XSD file or am I omitting a parameter when running XJC? Any help greatly appreciated

    LDAPLoginModule uses the jackrabbit UserManagerImpl to create user's in CRX (CQ), not the CQ5 implementation which is disappointing. Have to manually add the sling:resourceType.

  • Help on simple class definition

    This is just the class definition (main() is in its own file, but I was wondering if someone could help me figure out what is wrong w/ the code. I am trying to make a simple program that asks, "what is your name?", than you enter your name, and it says "hello, john, today is feb, 3rd" (or whatever).
    I'm not even sure if the code is right to do what I want to do, but I can't really figure that out if it won't compile.
    Oh, and here is the error message I am getting.
    HelloWorld.java:26: ')' expected
    System.out.println ("Hello " + yourName
    ^
    1 error
    import java.util.*;
    import java.io.*;
    class HelloWorld extends Object
    HelloWorld()
    BufferedReader in = new BufferedReader (new
    InputStreamReader(System.in));
    Date currentDate = new Date();
    String yourname;
    System.out.println ("Hello, please enter your name: ");
    yourName = in.readLine();
    System.out.println ("Hello " + yourName
    "Today is, " + currentDate );

    At this point in your code a java.io.IOException might occur.
    You have to declare your exception to be thrown:
    HelloWorld() throws IOException Or you catch the occuring exception in a try-catch-block:
    HelloWorld()
      try
       //your code here
      catch (IOException e)
       //What should be done with the exception
    Guinevere                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • This VI is part of a LabVIEW class. No part of the class is executable at this time because one of the member VIs is missing. However I am not missing a vi

    I only have 1 vi and its not missing.  The 1 vi claims the owning library has blocked the execution of the VI.  The class has the error "This VI is part of a LabVIEW class. No part of the class is executable at this time because one of the member VIs is missing. Find the missing member VIs on disk and load them into memory or delete them from the class definition in the project tree."
    But there is only 1 member vi!!??
    I had lots of other vi's as part of this class but somehow this class got botched with this error.  I removed all vi from the directory and from the class definition and re made just the one assessor vi and still got the error message.
    I have attached my ridiculously simple class.
    I have other classes that work fine but somehow this one seems to have gotten botched.  I really need to understand what happened here and how to recover/avoid this error or I will not have the confidence to develop large applications using classes.
    In other words...PLEASE HELP!
    Solved!
    Go to Solution.
    Attachments:
    Tree class.zip ‏14 KB

    I cannot tell you why.  Only what it is missing.
    If you look in the Tree.lvclass file using something like Notepad, towards the bottom you will see some XML that looks like:
    <Item Name="Untitled 1" Type="VI">
            <Property Name="NI.ClassItem.ConnectorPane" Type="Bin">#1#!!!!!!!)!"1!&amp;!!!-!%!!!@````]!!!!"!!%!!!$H!!!!#1!-1#%'=X2B&gt;(6T!!!,1!-!"'.P:'5!!""!-0````]'=W^V=G.F!!!71&amp;!!!Q!!!!%!!AFF=H*P=C"P&gt;81!"!!!!#*!=!!?!!!/$&amp;2S:75O&lt;(&lt;'&amp;T=Q!!#&amp;2S:75A&lt;X6U!!!A1&amp;!!!Q!!!!%!!B.F=H*P=C"J&lt;C!I&lt;G]A:8*S&lt;X)J!#"!=!!?!!!/$&amp;2S:75O&lt;(&lt;'&amp;T=Q!!"V2S:75A;7Y!0!$Q!!Q!!Q!%!!1!"1!%!!1!"!!%!!9!"!!%!!=#!!"Y$1A!!!!!D1M!!!!!!!!!!!A!!!!!!*!!!!!!!1!)!!!!!!</Property>
            <Property Name="NI.ClassItem.ExecutionSystem" Type="Int">-1</Property>
            <Property Name="NI.ClassItem.Flags" Type="Int">0</Property>
            <Property Name="NI.ClassItem.IsStaticMethod" Type="Bool">false</Property>
            <Property Name="NI.ClassItem.MethodScope" Type="UInt">1</Property>
            <Property Name="NI.ClassItem.Priority" Type="Int">1</Property>
            <Property Name="NI.ClassItem.State" Type="Int">1342841344</Property>
        </Item>
    Delete this block.  Make a backup of the file before you do that.  Start up LV and load the class again.
    My guess is that something probably did not save properly when LV shut down.  I have a large OO project and have had more than one occasion where I have corrupted the project but could ot figure out why. 
    Today I had a similar message which is why your post caught my eye.  In doing some troubleshooting I found that it no longer 'knew' where one of my files was but it never complained when it loaded the project.  I went back to the original project and tried to open that vi from the project.  That is when it told me that the vi was not in the expected location, do you want to correct it.  I said yes and all was better. 
    Trying to open all of the VIs in the class might have worked, but this can be cumbersome to say the least in a large class.
    Good luck,
    Kurt

  • Importing the class in Oracle Rules Author Definitions

    I created the Dictionary in the Oracle Rules Author.
    In the Definitions Page I selected the java fact type.
    In the User Classpath i gave the class path of the files.
    Then i have to import my class in the Rules Repository.
    I am getting the following error.
    Cannot perform operation. RUL-01527: Received exception for loadClass. RUL-01016: Cannot load Java class example3.Retiree. Please make sure the class and all its dependent classes are either in the class path, or user specified path. Root Cause: example3/Retiree (Unsupported major.minor version 49.0)
    Can any one respond to this query please...

    You have to do like the others import. You have to put import and the complete path(with all the packages).
    For example:
    import mypackage.msgsend;
    and if you wouls like to import all the classes of a package use:
    import mypackage.*;

  • Is the "Device Class Definition for Physical Interface Devices" specification implemented in Windows?

    Can I assume that Windows will be able to handle my physical interface device if I follow the "Device Class Definition for Physical Interface Devices" specification while writing the firmware?
    I'm trying to develop a device which handles rumble output from applications such as games. Applications would include e.g. racing games or simulators. I'm hesitant to just clone Xbox 360 Gamepad or Sidewinder USB reports. I'd like to correctly declare my
    device as something on its own while still making use of already implemented OS-specific drivers. The purpose of the mentioned specification is exactly that as far as I can tell. I wasn't able to find concrete information about its level of support though.
    The "USB device class drivers included in Windows" page (sorry I'm not allowed to post links yet..) seems to link to WinUSB which I'm not sure what to do with.

    Thanks for your response. Well if everything was implemented at that time and it's still available it should be fine since the specification document's last version is dated 1999. I was just hoping there would be any form of documentation whether it's
    supported and by which degree so I don't go through the trouble of figuring out how the firmware should be written according to the specification just to find out there is no OS driver implementation for it which would render my work more or less useless.
    So I suppose I'm forced to go the trial and error path?

  • Binary class definition not found: Hello  --- When access the sample

    Hi,
    I followed the the document of
    Oracle9iAS Release 2 Containers for J2ee
    dated 12/01/01
    to deploy the stateless pure java web service, Hello.
    When I hit
    http://server:port/hellows/helloService?wsdl
    I got the generated WSDL
    Also, I can get the proxy class source and jar from
    http://server:port/hellows/helloService?proxy_jar
    http://server:port/hellows/helloService?proxy_source
    However, after I compiled HelloClient and HelloProxy, I got the following error when I tried to access the web service, Hello
    Any advice is appreciated.
    Qiming
    [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type "text/html", must be: "text/xml". Response was:
    <HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD><BODY><H1>500 Internal Server Error</H1><PRE>oracle.j2ee.xanadu.JasperGenerationError: no source generated during code generation!: 1 in getFile name: \Hello.class
    <br>1 in getFile name: \Hello.java
    <br>error: error message &apos;class.format&apos; not found<br>binary class definition not found: Hello
    <br>
    <br>     at oracle.j2ee.ws.JavaWrapperGenerator.generate(JavaWrapperGenerator.java:267)
    <br>     at oracle.j2ee.ws.RpcWebService.generateWrapperClass(RpcWebService.java:668)
    <br>     a[i]Long postings are being truncated to ~1 kB at this time.

    You may want to try the latest and greatest OC4J 9.0.3 which is on OTN at:
    OC4J 9.0.3: http://otn.oracle.com/software/htdocs/devlic.html?/software/products/ias/htdocs/utilsoft.html
    The updated Web service writeups are in:
    <oc4j_home>\webservices\demo\demo.zip (unzip and look in the <demo_unzip>\basic\java_services\README.txt)
    One thing that might cause your problem is making sure your class path is updated to point to all the right class files as described in the writeup, including the jar file containing the downloaded class files.
    Mike.

  • Background Job cancelling with error Data does not match the job definition

    Dear Team,
    Background Job is getting cancelled when I run a Job on periodically but the same Job is executing perfectly when I run it manually(repeat scheduling) .
    Let me describe the problem clearly.
    We have a program which picks up files from an FTP server and posts the documents into SAP. We are scheduling this program as a background Job daily. This Job is running perfectly if the files contain no data. But if the file contains data the JOb is getting cancelled with the following messages.
    And also the same Job is getting executed perfectly when repeat scheduling is done ( even for files with data).
    Time     Message text                                                                       Message class Message no. Message type
    03:46:08 Job PREPAID_OCT_APPS2_11: Data does not match the job definition; job terminated        BD           078          E
    03:46:08 Job cancelled after system exception ERROR_MESSAGE                                      00           564          A
    Please help me in resolving this issue.
    Thanks in advance,
    Sai.

    hi,
    If you have any GUI function modules used in the program of job
    you cannot run it in background mode.

  • Duplicate class definition error while invoking EJB from ADF project

    Hi,
    I am using Jdeveloper TP3 and facing the following problem.
    I have built an EJB project and am ran them successfully in the embedded OC4J via a standalone java program.
    Now I created another project with ADF capabilities and when I tried to ping the EJB i get the following exception
    The application named, current-workspace-app, could not start due to an error.
    duplicate class definition: javax/faces/context/FacesContextFactory Invalid class: javax.faces.context.FacesContextFactory Loader
    This is happenning due to class conflicts between javaee.jar and trinidad-impl.jar/adf-richclient-impl.jar.
    Is there any way of bypassing this class loader issue?

    Hi,
    actually I didn' try the JNDI lookup but used resource injection instead
    In a JSF managed bean I use
    @EJB Ejb30SessionFacadeLocal myLocalInterface;
    public SortableModel getTableModel() {
    List rows = new ArrayList<Employees>();
    rows = myLocalInterface.queryEmployeesFindAll();
    this.tableModel = new SortableModel(rows);
    return tableModel;
    Its a EJB 3.0 session bean that accesses a Local interface. However, if the remote is on the same server then I would think that using @EJB Ejb30SessionFacadeRemote myRemoteInterface; does similar
    Frank

Maybe you are looking for

  • Lock Screen In MBP

    I need to know how to lock my screen on my MBP. I want to do it kind of the same way you do in windows. ctrlAlt+DelEnter. how do I do this on the Mac? Thank you, Jason.

  • Pantone Fashion+home Color book

    HI, Anyone know if there is any chance to have the pantone color book for Fashion? I need to have the color book in the picker, so i need an .acb file extension, but not sure if the one for fashion is ever been created. I was able to make a .ase and

  • Exporting Clips for use in another application

    I want to export clips from Final Cut Pro X version 10.1.1 retain the clips in Final Cut and be able to use the clips in premiere.  Any ideas.

  • Gutscheincode Edge Animate CC nach abgelaufener Testversion und Kauf

    Hi Leute, ich hatte vor 2 Monaten die Edge Animate CC Testversion installiert und diese ist folglich nach 30 Tagen abgelaufen. Nun habe ich mich einen Monat später dazu entschieden mir das Produkt für einen Monat zu bestellen. Hat auch alles wunderba

  • I have got the recovery key wrong error.

    I am using this key for a year but this time after i changed my windows this error showed up.