Package com.hazelcast.config
Class ListenerConfig
java.lang.Object
com.hazelcast.config.ListenerConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
- Direct Known Subclasses:
CachePartitionLostListenerConfig
,EntryListenerConfig
,ItemListenerConfig
,MapPartitionLostListenerConfig
,SplitBrainProtectionListenerConfig
Contains the configuration for an
EventListener
. The configuration
contains either the classname of the EventListener implementation, or the
actual EventListener instance.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a ListenerConfig without className/implementation.ListenerConfig
(ListenerConfig config) ListenerConfig
(String className) Creates a ListenerConfig with the given className.ListenerConfig
(EventListener implementation) Creates a ListenerConfig with the given implementation. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns type identifier for this class.Returns the name of the class of the EventListener.int
Returns DataSerializableFactory factory ID for this class.Returns the EventListener implementation.int
hashCode()
boolean
boolean
isLocal()
void
Reads fields from the input streamsetClassName
(String className) Sets the class name of the EventListener.setImplementation
(EventListener implementation) Sets the EventListener implementation.toString()
void
Writes object fields to output stream
-
Field Details
-
className
-
implementation
-
-
Constructor Details
-
ListenerConfig
public ListenerConfig()Creates a ListenerConfig without className/implementation. -
ListenerConfig
Creates a ListenerConfig with the given className.- Parameters:
className
- the name of the EventListener class- Throws:
IllegalArgumentException
- if className isnull
or an empty String
-
ListenerConfig
Creates a ListenerConfig with the given implementation.- Parameters:
implementation
- the implementation to use as EventListener- Throws:
IllegalArgumentException
- if the implementation isnull
-
ListenerConfig
-
-
Method Details
-
getClassName
Returns the name of the class of the EventListener. If no class is specified, null is returned.- Returns:
- the class name of the EventListener
- See Also:
-
setClassName
Sets the class name of the EventListener.If a implementation was set, it will be removed.
- Parameters:
className
- the name of the class of the EventListener- Returns:
- the updated ListenerConfig
- Throws:
IllegalArgumentException
- if className isnull
or an empty String- See Also:
-
getImplementation
Returns the EventListener implementation. If none has been specified, null is returned.- Returns:
- the EventListener implementation
- See Also:
-
setImplementation
Sets the EventListener implementation.If a className was set, it will be removed.
- Parameters:
implementation
- the EventListener implementation- Returns:
- the updated ListenerConfig
- Throws:
IllegalArgumentException
- the implementation isnull
- See Also:
-
isIncludeValue
public boolean isIncludeValue() -
isLocal
public boolean isLocal() -
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode()
-