Crossfire JXClient, Trunk
|
Classes | |
class | LoadTask |
class | SaveTask |
Public Member Functions | |
FileCacheFaceQueue (@NotNull final ImageCache imageCacheOriginal, @NotNull final ImageCache imageCacheScaled, @NotNull final ImageCache imageCacheMagicMap) | |
void | loadFace (@NotNull final Face face) |
void | reset () |
void | saveFace (@NotNull final Face face, @NotNull final FaceImages faceImages) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.faces.AbstractFaceQueue | |
void | addFaceQueueListener (@NotNull final FaceQueueListener faceQueueListener) |
void | removeFaceQueueListener (@NotNull final FaceQueueListener faceQueueListener) |
Private Attributes | |
final ExecutorService | executorService = Executors.newFixedThreadPool(1) |
int | id |
final ImageCache | imageCacheMagicMap |
final ImageCache | imageCacheOriginal |
final ImageCache | imageCacheScaled |
final Collection< Face > | pendingLoadFaces = new HashSet<>() |
final Object | sync = new Object() |
Additional Inherited Members | |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.faces.AbstractFaceQueue | |
void | fireFaceFailed (@NotNull final Face face) |
void | fireFaceLoaded (@NotNull final Face face, @NotNull final FaceImages faceImages) |
A FaceQueue loading faces from ImageCache instances.
Definition at line 36 of file FileCacheFaceQueue.java.
com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.FileCacheFaceQueue | ( | @NotNull final ImageCache | imageCacheOriginal, |
@NotNull final ImageCache | imageCacheScaled, | ||
@NotNull final ImageCache | imageCacheMagicMap | ||
) |
Creates a new instance.
imageCacheOriginal | the image cache used for loading original image files |
imageCacheScaled | the image cache used for loading scaled image files |
imageCacheMagicMap | the image cache used for loading magic map image files |
Definition at line 93 of file FileCacheFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.imageCacheMagicMap, com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.imageCacheOriginal, and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.imageCacheScaled.
void com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.loadFace | ( | @NotNull final Face | face | ) |
Request a face. Must eventually call either FaceQueueListener#faceLoaded(Face, FaceImages) or FaceQueueListener#faceFailed(Face) for the face. Faces re-requested while still processing may be notified only once.
face | the requested face |
Implements com.realtime.crossfire.jxclient.faces.FaceQueue.
Definition at line 108 of file FileCacheFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.executorService, com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.pendingLoadFaces, and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.sync.
Referenced by com.realtime.crossfire.jxclient.faces.FacesQueue.loadFace().
void com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.reset | ( | ) |
Reset the processing: forget about pending faces. This function is called whenever the server socket breaks, or when a new connection has been established.
Implements com.realtime.crossfire.jxclient.faces.FaceQueue.
Definition at line 100 of file FileCacheFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.pendingLoadFaces, and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.sync.
Referenced by com.realtime.crossfire.jxclient.faces.FacesQueue.reset().
void com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.saveFace | ( | @NotNull final Face | face, |
@NotNull final FaceImages | faceImages | ||
) |
Saves a face to the caches. This function returns immediately; the faces are written asynchronously.
face | the face to write |
faceImages | the image information to write |
Definition at line 124 of file FileCacheFaceQueue.java.
References com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.executorService.
|
private |
The ExecutorService used to execute face loading. The pool consists of one thread; this means all requests are serialized.
Definition at line 67 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.loadFace(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.saveFace().
|
private |
Counts the number of calls to reset(). An ExecutorService does not allow to cancel scheduled but still pending requests. Therefore, the thread checks if this ID matches the ID value at creation time. If the IDs do not match it exits.
Definition at line 82 of file FileCacheFaceQueue.java.
|
private |
The image cache used for loading magic map images.
Definition at line 60 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.FileCacheFaceQueue(), com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.LoadTask.run(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.SaveTask.run().
|
private |
The image cache used for loading original images.
Definition at line 48 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.FileCacheFaceQueue(), com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.LoadTask.run(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.SaveTask.run().
|
private |
The image cache used for loading scaled images.
Definition at line 54 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.FileCacheFaceQueue(), com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.LoadTask.run(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.SaveTask.run().
|
private |
The faces for which loadFace(Face) has been called but that are not yet processed.
Definition at line 74 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.loadFace(), com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.reset(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.LoadTask.run().
|
private |
The object used for synchronization.
Definition at line 42 of file FileCacheFaceQueue.java.
Referenced by com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.loadFace(), com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.reset(), and com.realtime.crossfire.jxclient.faces.FileCacheFaceQueue.LoadTask.run().