Skip to content

Commit

Permalink
Merge pull request #1843 from joshmoore/disable-chgrp-event-logs
Browse files Browse the repository at this point in the history
Disable chgrp event logs
  • Loading branch information
joshmoore committed Jan 7, 2014
2 parents 9596452 + 92b6abe commit daa2557
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
6 changes: 6 additions & 0 deletions build.xml
Expand Up @@ -942,6 +942,12 @@ omero.version=${omero.version}
<hotdeploy component="${server.comp}" targets="${targets}"/>
</target>

<target name="hot-bioformats" depends="init" description="Re-launch running bioformats with new bioformats.jar">
<property name="targets" value="dist"/>
<hotdeploy component="${basedir}/components/bioformats" targets="${targets}"/>
</target>


<macrodef name="hotdeploy">
<attribute name="targets"/>
<attribute name="component"/>
Expand Down
18 changes: 18 additions & 0 deletions components/blitz/src/omero/cmd/graphs/ChgrpI.java
Expand Up @@ -7,6 +7,8 @@

package omero.cmd.graphs;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -22,6 +24,7 @@
import ome.services.graphs.GraphException;
import ome.services.graphs.GraphSpec;
import ome.services.graphs.GraphState;
import ome.services.messages.EventLogMessage;
import ome.system.EventContext;
import ome.system.ServiceFactory;
import ome.tools.hibernate.HibernateUtils;
Expand Down Expand Up @@ -139,6 +142,7 @@ public void init(Helper helper) {

}

@SuppressWarnings("deprecation")
public Object step(int i) throws Cancel {
helper.assertStep(i);

Expand All @@ -150,6 +154,20 @@ public Object step(int i) throws Cancel {
Session s = helper.getSession();
IObject obj = spec.load(s);
s.refresh(obj);

EventLogMessage elm = new EventLogMessage(this, "CHGRP",
obj.getClass(),
Arrays.asList(Long.valueOf(this.id)));

try {
helper.getServiceFactory()
.getContext().publishMessage(elm);
} catch (Throwable t) {
GraphException de = new GraphException("EventLogMessage failed.");
de.initCause(t);
throw de;
}

return null;
} else {
return state.execute(i);
Expand Down
10 changes: 0 additions & 10 deletions components/server/src/ome/services/chgrp/ChgrpStep.java
Expand Up @@ -169,16 +169,6 @@ private Long findImproperIncomingLinks(Session session, String[] lock) {
@Override
public void onRelease(Class<IObject> k, Set<Long> ids)
throws GraphException {
EventLogMessage elm = new EventLogMessage(this, "CHGRP", k,
new ArrayList<Long>(ids));

try {
ctx.publishMessage(elm);
} catch (Throwable t) {
GraphException de = new GraphException("EventLogMessage failed.");
de.initCause(t);
throw de;
}

}

Expand Down
10 changes: 0 additions & 10 deletions components/server/src/ome/services/chgrp/ChgrpValidation.java
Expand Up @@ -132,16 +132,6 @@ private Long findImproperOutgoingLinks(Session session, String[] lock) {
@Override
public void onRelease(Class<IObject> k, Set<Long> ids)
throws GraphException {
EventLogMessage elm = new EventLogMessage(this, "CHGRP-VALIDATION", k,
new ArrayList<Long>(ids));

try {
ctx.publishMessage(elm);
} catch (Throwable t) {
GraphException de = new GraphException("EventLogMessage failed.");
de.initCause(t);
throw de;
}

}

Expand Down
14 changes: 7 additions & 7 deletions components/server/src/ome/services/graphs/GraphStep.java
Expand Up @@ -176,14 +176,14 @@ public void setEventContext(EventContext ec) {
this.ec = ec;
}

/**
* Currently returns the ID array without copying
* therefore values should not be leaked to code outside
* of the ome.services.graphs hierarchy. Non-copying is
* primarily intended to reduce GC overhead.
*/
public long[] getIds() {
if (this.ids == null) {
return null;
}

long[] copy = new long[ids.length];
System.arraycopy(ids, 0, copy, 0, copy.length);
return copy;
return this.ids;
}

//
Expand Down

0 comments on commit daa2557

Please sign in to comment.