org.jboss.deployers.plugins.attachments
Class AttachmentsImpl

java.lang.Object
  extended by org.jboss.deployers.spi.attachments.helpers.AbstractAttachments
      extended by org.jboss.deployers.spi.attachments.helpers.AbstractMutableAttachments
          extended by org.jboss.deployers.plugins.attachments.AttachmentsImpl
All Implemented Interfaces:
Externalizable, Serializable, Attachments, MutableAttachments

public class AttachmentsImpl
extends AbstractMutableAttachments

Attachments implementation

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
AttachmentsImpl()
           
 
Method Summary
 Object addAttachment(String name, Object attachment)
          Add attachment
 void clear()
          Clear the attachments
 void clearChangeCount()
          Reset the change count to zero.
 Object getAttachment(String name)
          Get attachment
 Map<String,Object> getAttachments()
          Get all the attachments
 int getChangeCount()
          Get the number of changes that have happened.
 boolean hasAttachments()
          Are there any attachments
 boolean isAttachmentPresent(String name)
          Is the attachment present
 void readExternal(ObjectInput in)
           
 Object removeAttachment(String name)
          Remove attachment
 void setAttachments(Map<String,Object> map)
          Set the attachments
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.AbstractMutableAttachments
addAttachment, addAttachment, removeAttachment, removeAttachment
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.AbstractAttachments
getAttachment, getAttachment, isAttachmentPresent, isAttachmentPresent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.spi.attachments.Attachments
getAttachment, getAttachment, isAttachmentPresent, isAttachmentPresent
 

Constructor Detail

AttachmentsImpl

public AttachmentsImpl()
Method Detail

getAttachments

public Map<String,Object> getAttachments()
Description copied from interface: Attachments
Get all the attachments

Returns:
the unmodifiable attachments

setAttachments

public void setAttachments(Map<String,Object> map)
Description copied from interface: MutableAttachments
Set the attachments

Specified by:
setAttachments in interface MutableAttachments
Overrides:
setAttachments in class AbstractMutableAttachments
Parameters:
map - the new attachments a map of names to attachments

addAttachment

public Object addAttachment(String name,
                            Object attachment)
Description copied from interface: MutableAttachments
Add attachment

Parameters:
name - the name of the attachment
attachment - the attachment
Returns:
any previous attachment

getAttachment

public Object getAttachment(String name)
Description copied from interface: Attachments
Get attachment

Parameters:
name - the name of the attachment
Returns:
the attachment or null if not present

isAttachmentPresent

public boolean isAttachmentPresent(String name)
Description copied from interface: Attachments
Is the attachment present

Parameters:
name - the name of the attachment
Returns:
true when the attachment is present

removeAttachment

public Object removeAttachment(String name)
Description copied from interface: MutableAttachments
Remove attachment

Parameters:
name - the name of the attachment
Returns:
the attachment or null if not present

clear

public void clear()
Description copied from interface: MutableAttachments
Clear the attachments


hasAttachments

public boolean hasAttachments()
Description copied from interface: Attachments
Are there any attachments

Returns:
true if there are any attachments, false otherwise.

getChangeCount

public int getChangeCount()
Description copied from interface: MutableAttachments
Get the number of changes that have happened.

Returns:
number of adds/removes that have happened since creation or clearChangeCount.

clearChangeCount

public void clearChangeCount()
Description copied from interface: MutableAttachments
Reset the change count to zero.


toString

public String toString()
Overrides:
toString in class Object

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractAttachments
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractAttachments
Parameters:
out - the output
Throws:
IOException - for any error


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.