WPSInfo wps = gs.getService(WPSInfo.class);
// remove all jts processes but buffer
NameImpl bufferName = new NameImpl("JTS", "buffer");
ProcessFactory jts = Processors.createProcessFactory(bufferName);
ProcessGroupInfo jtsGroup = new ProcessGroupInfoImpl();
jtsGroup.setFactoryClass(jts.getClass());
jtsGroup.setEnabled(true);
List<Name> jtsNames = new ArrayList<Name>(jts.getNames());
jtsNames.remove(bufferName);
jtsGroup.getFilteredProcesses().addAll(jtsNames);
List<ProcessGroupInfo> pgs = wps.getProcessGroups();
pgs.clear();
pgs.add(jtsGroup);
// remove the feature gs factory
ProcessGroupInfo gsGroup = new ProcessGroupInfoImpl();
gsGroup.setFactoryClass(VectorProcessFactory.class);
gsGroup.setEnabled(false);
pgs.add(gsGroup);
gs.save(wps);
}