Use of marker Interface

can any bdy plz tell me what is the use of marker interface ????

Please search the forums before asking such a common question.

Similar Messages

  • What is the use of Marker Interfaces?

    What is the use of marker interfaces?
    As it is not having any methods or fileds what is the benefit I will get by implementing those interfaces?
    Servlet implements SingleThread
    What it will do behind the scenes exactly as singleThread model is marker interface

    The use of marker interfaces is to act as markers (shock horror)
    It is quite a common way to tell a program what a class can/can't do: Cloneable, Serializable etc etc
    This doesn't change the functionality of the class itself, but is more an indication as to what can be done with this class.
    In this case the servlet container can then tell whether or not it implements the interface, and can treat it accordingly. Implementing this interface tells the container you want it to run this servlet in singleThreaded mode.
    Thats all there is to it.
    It would be along the lines of
    Servlet servlet = loadServlet("...")
    if (servlet instanceof SingleThreadModel){
    // Single threaded servlet - start new process for it
    else {
    // regular servlet - reuse existing object.

  • Marker interface query?

    what is the use of marker interface ?
    serializable ,clonable ,Runnable interfaces are marker interfaces .
    when any of the classes implemets these interfaces that classes will get the properities of marker interfaces .
    But , what r those properties?
    what is happening in back ground when we implements these marker interfaces ?

    what is the use of marker interface ?Let me ask a quesiton to you first: what is the use of a forum search?
    serializable ,clonable ,Runnable interfaces are
    marker interfaces .Not Runnable.
    when any of the classes implemets these interfaces
    that classes will get the properities of marker
    interfaces .If you mean by "implementing" only that it'll be included in the implements declaration: you're wrong. You also make sure that your class complies with the restrictions/behaviour imposed.
    what is happening in back ground when we implements
    these marker interfaces ?Nothing.

  • Marker interfaces

    what is the use of marker interfaces when do not specify any methods?

    This is discussed about once every week or every other week on this site. I suggest that you search this site for those previous discussions. They will have all you need. Also, have a look at google and wikipedia:
    http://en.wikipedia.org/wiki/Marker_interface_pattern

  • About Marker Interfaces

    what is the use of marker interfaces and y do we need them

    Here's an example I'm using:
    I've got a program which displays lots of tables, it doesn't just display them, it prints them and it dumps them to Excell files.
    Many of these tables have a total row at the bottom which needs highlighting. I flag the TableModel with a marker interface of my own. Then the various ways that table data is handled, when passed the TableModel, know to use a modifled JTable, or to use special formating flags on the last row.

  • JSF-Marker Interface

    Hai Friends
    I want to know what is use of marker interface in java(JSF) and also how it is working without having even single method declaration & definitions inside that interfece like Remote interface,serialization and so on.
    Thanks
    Selvakumar .k

    Marker Interfaces work the same way as they do anywhere else. Please read about marker interfaces.

  • What is the significance of Marker interface? Why are we using, even though

    What is the significance of Marker interface? Why are we using, even though it has no method?

    Well, what's the significance of an interface? They can define a set of methods a class may implement but the class could equally well implement these methods without the interface so why having interfaces at all?
    The answer is that the most important aspect of an interface is that it constitutes a type (you can declare variables of it). And it's a type regardless of how many methods it defines, including none. So the reason for having a marker interface is that you're interested solely in the type aspect of interfaces.

  • Marker interface use

    In which case Marker interface is getting use plz tell

    Marker Interfaces are giving specification to the JVM about the implementing classes.
    One of the features of the Java programming language is that it mandates a separation between interfaces (pure behavior) and classes (state and behavior). Interfaces are used in Java to specify the behavior of derived classes. Often you will come across interfaces in Java that have no behavior. In other words, they are just empty interface definitions. These are known as marker interfaces. Marker interfaces are also called "tag" interfaces since they tag all the derived classes into a category based on their purpose.
    Some examples of marker interfaces in the Java API include: -
    Java.lang.Cloneable
    A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class.
    java.io.Serializable
    Serialization is nothing but s saving the state of an object to persistent storage as byte stream. Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable. To allow subtypes of non-serializable classes to be serialized, the subtype may assume responsibility for saving and restoring the state of the supertype's public, protected, and (if accessible) package fields. The subtype may assume this responsibility only if the class it extends has an accessible no-arg constructor to initialize the class's state. It is an error to declare a class Serializable if this is not the case. The error will be detected at runtime.
    java.util.EventListener
    A tagging interface that all event listener interfaces must extend.
    java.rmi.Remote
    The Remote interface serves to identify interfaces whose methods may be invoked from a non-local virtual machine. Any object that is a remote object must directly or indirectly implement this interface. Only those methods specified in a "remote interface", an interface that extends java.rmi.Remote are available remotely.
    Javax.servlet.SingleThreadModel
    Ensures that servlets handle only one request at a time. This interface has no methods. If a servlet implements this interface, you are guaranteed that no two threads will execute concurrently in the servlet's service method.
    Java.util.RandomAccess
    This Marker interface used by List implementations (ArrayList, Vector) to indicate that they support fast (generally constant time) random access. The primary purpose of this interface is to allow generic algorithms to alter their behavior to provide good performance when applied to either random or sequential access lists.
    Javax.ejb.EnterpriseBean
    The EnterpriseBean interface must be implemented by every enterprise Bean class. It is a common superinterface for the SessionBean, EntityBean and MessageDrivenBean interfaces.
    Reference From Sun Documentation

  • Refusal to use marker interface as parameter?

    Heya all,
    I've seen a lot of professional (ie Apache, Sun, etc) Java code that has code similar to this:
    public void serialise(Object o)
       if (o instanceof Serializable)
          throw new IllegalArgumentException("Object is not serializable");
       ... code here...
    }Whereas surely it could be re-written as:
    public void serialise(Serializable o)
       ... code here...
    }Thus giving us compile-time type safety. I seem to get the impression that 'Serializable' and 'Cloneable' and other such 'marker' interfaces shouldn't be used as parameters in this way because they are not 'real' interfaces as such. I usually prefer the second form; but I have seen both forms fairly commonly.
    Any comments/suggestions on when it's better to use different ways?

    Then allow me to be more specific, without retracting my original point. The following methods within java.io.ObjectInputStream and java.io.ObjectOutputStream which current exist as:
    public Object readObject() throws IOException {}
    public void writeObject(Object object) throws IOException {}Could easily be re-written (and be more specific and type-safe) via the following declarations:
    public Serializable readObject() throws IOException{}
    public void writeObject(final Serializable object) throws IOException {}I would further propose renaming then SerializableInputStream and SerializableOutputStream, as they do not truly take all instances of java.lang.Object.
    - Saish

  • How do i pass a daqmx task from labview to matlab using the math interface toolkit?

    I want to use DAQMX functions from Matlab using the Math Interface Toolkit (MIT). How can I have a labview function output (return) the DAQMX task to matlab via the MIT?
    I want to do this so I can start a DAQMX task in Labview from a matlab function and return control to matlab without losing the task.

    Hi Mark,
    (I already posted this answer in your other thread, but let's keep THIS thread alive - it makes more sense here in the LabVIEW forum than in Instrument Control forum.)
    Since the DAQmx Task is not a native data type that can be passed directly to MATLAB from LAbVIEW, try flattening the DAQmx Task to a string before passing to MATLAB. However, I doubt that you can access the task from within MATLAB, but feel free to give it a try.
    Good luck!
    - Philip Courtois, Thinkbot Solutions

  • MARKER INTERFACE WHY?

    hello i madhav new to this forum , i have doubt on marker interface . as it doesnot have any body why we r using that one instead of skipping.Is there any concept behind is there.More about my doubt is Take Example Cloneable Interface it Doesn't Have any Method In it,Clone() method is from Object class,then what is the necessity of implementing the interface .Why it should not be like that.
    what is real technolgy behind MarkerInteface and Why we r going to be used in what situations it will needed.And Lastly is there any method related to Serailizable interface if not what it do .
    marker interface can also called as Tag interface what is tag mean here just saying combing derived classes . i didn't get that one and how it will be .
    if u could explain with example or real time project it would be better for me
    thanks in advance

    What is a "marker" interface?
    Marker Interface pattern
    c2.com - Marker Interface
    experts.about.com - Marker Interfaces
    The Purpose of the Marker Interface
    Maximize your Design ROI with Marker Interfaces and JavaDoc

  • Failed to get DHCP response on interface "Marking interface dirty"

    Dears
    i have WLC 5508 showing the below Logs , which prevent the users from connecting to the SSIDs , also its disconnecting the associted users
    DHCP Socket Task: Jul 11 09:54:08.992: %SIM-3-DHCP_SERVER_NO_REPLY: sim_interface.c:1039 Failed to get DHCP response on interface 'interface-02'. Marking interface dirty.
    *mmListen: Jul 11 09:54:08.638: %MM-3-INVALID_PKT_RECVD: mm_listen.c:7671 Received an invalid packet from 10.21.1.25. Source member:0.0.0.0. source member unknown.
    it shows 3 to 4 times durring 1 hour ,        
    any idea about the problem , and what exactly Dirty interface means ??

    looks like you could be using interface group.
    (WLC) >show interface group detailed
    Interface marked with * indicates DHCP dirty interface.
    whenever the existing interface goes dirty does the client tries the next available interface for dhcp.
    The idea of Interface Groups is that you can have a WLAN utilize multiple interfaces/VLANs/Subnets/DHCP Pools, either for load balancing. At its heart it is purely round robin or based on hash generated using mac address(it depends on the wlc code), but should a client connect in on a certain interface and not be able to complete the DHCP process we mark it as dirty for 30 minutes.  During those 30 minutes we basically remove that Interface from the Interface Group as it won't be selected for use.

  • Marker Interface

    Hi,
    The Marker Interface is interface with no body(it serve only as a Tag) . So what is thew use of it.Can we write our own Marker Interface?if yes how?
    How does a clone method knows that the calling object implements Clonable?Is this hard coded in the compiler or JVM ?
    Thanks
    Bipul

    The Marker Interface is interface with no body(it
    serve only as a Tag) . So what is thew use of it.To mark that a certain class's implementation includes the necessary precautions for objects of that cass to be safely cloned/serialized/whatevered...
    Can
    we write our own Marker Interface?if yes how?As you noticed: simply write an interface without methods. Duh...
    How does a clone method knows that the calling object
    implements Clonable?Is this hard coded in the
    compiler or JVM ?instanceof

  • What is marker Interface

    hi
    what is marker interface
    what is the use of it
    plz give me reply
    bye

    Marker interface is an interface without any method.
    Eg : Serializable
    refer this link
    http://forum.java.sun.com/thread.jspa?threadID=597388&messageID=3787740

  • Java Marker Interface Examples

    I know that java.io.Serializable is a Marker Interface.
    Is there any other Marker Interface/s in java API ?
    Could you please list them?
    Edited by: TimJac on Nov 12, 2010 12:40 PM

    YoungWinston wrote:
    EJP wrote:
    javax.security.auth.callback.Callback.
    A topic of never-ending fascination.That's nothing. Did you see his "give me a list of Singletons" thread? Riveting.
    Is he the same person who used to ask for all the programs written in Java?

Maybe you are looking for

  • Arrears and Deductions

    Dear Friends, I am working in payroll internation (UAE).  We are facing an issue which needs to be addressed imm . there is a scenario in which employee was absconding he has almost one month unauthorised leave ..and his payroll was locked he came ba

  • Error while loading the Repository database using OAIIMPORT

    We are building a test oai environment I am trying to load the repository with the export dump from our production oai using the OAIIMPORT script. I get the following error message: Deleting all tables, indexes, and logs ... Executing: sqlplus system

  • Contact bug with non English last name

    I put the chinese name as last name, so that they will show up on the contact next to the English first name ie. George [chinese], this worked no problem, but when I send sms to more than one such contact it will fail with "xxx is not on the contact.

  • Dynamic Link not available

    When I try open a video file in Photoshop I get the message "Could not complete your request because DynamicLink is not available."  Any ideas?

  • ACS SE Agent aupport for 64 Bit Windows 2008

    Greetings All, Is there ACS SE agent support for a 64 Bit Windows 2008 Server. I was told there was not, I just want to confirm. thanks.