Skip to content

Commit

Permalink
cells: update CellMessage to work with initially empty messages
Browse files Browse the repository at this point in the history
Motivation:

Currently dcap uploads do not work because PoolManagerStub#send
sends the request with a CellMessage created with a zero-argument
constructor, and such a CellMessage has no destination.

Modification:

Update zero-args CellMessage to have an empty CellPath for destination
rather than null.  Update CellPath insert methods so they work with an
empty CellPath.

Result:

dcap uploads work again.

Target: master
Requires-notes: no
Requires-book: no
Patch: https://rb.dcache.org/r/9592/
Acked-by: Gerd Behrmann
  • Loading branch information
paulmillar committed Aug 8, 2016
1 parent f90ced0 commit 4e1ce03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/cells/src/main/java/dmg/cells/nucleus/CellMessage.java
Expand Up @@ -64,14 +64,9 @@ public CellMessage(CellPath path, Serializable msg)
}

public CellMessage(CellPath path)
{
this();
_destination = path;
}

public CellMessage()
{
_source = new CellPath();
_destination = path;
_creationTime = System.currentTimeMillis();
_receivedAt = _creationTime;
_mode = ORIGINAL_MODE;
Expand All @@ -80,6 +75,11 @@ public CellMessage()
_session = CDC.getSession();
}

public CellMessage()
{
this(new CellPath());
}

@Override
public String toString(){
StringBuilder sb = new StringBuilder() ;
Expand Down
6 changes: 6 additions & 0 deletions modules/cells/src/main/java/dmg/cells/nucleus/CellPath.java
Expand Up @@ -115,11 +115,17 @@ public synchronized CellPath clone()
*/
public synchronized void insert(CellPath path)
{
if (_position < 0) {
_position = 0;
}
_list.addAll(_position, path._list);
}

public synchronized void insert(CellAddressCore address)
{
if (_position < 0) {
_position = 0;
}
_list.add(_position, address);
}

Expand Down

0 comments on commit 4e1ce03

Please sign in to comment.