1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

IDMContext.java - spelling

DsfServiceID.java - new helper utility class use to generate class IDs
DsfMemoryBlockRetrieval.java - uses DsfServiceID now
SyncRegisterDataAccess.java - uses DsfServiceID now
AlarmCellModifier.java -  uses DsfServiceID now
DisplayDsfExecutor.java - changed getDisplayDsfExecutor to return DisplayDsfExecutor instead opf DsfExecutor.
AbstractCachingVMProvider.java - spelling/format
This commit is contained in:
Randy Rohrbach 2008-01-31 15:58:01 +00:00
parent 5dd23d3028
commit bd49549561
6 changed files with 48 additions and 34 deletions

View file

@ -33,6 +33,7 @@ import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterDMData;
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMContext;
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMData;
import org.eclipse.dd.dsf.debug.ui.DsfDebugUIPlugin;
import org.eclipse.dd.dsf.service.DsfServiceID;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.dsf.service.IDsfService;
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext;
@ -62,11 +63,12 @@ public class SyncRegisterDataAccess {
@ThreadSafe
private synchronized IRegisters getService() {
String serviceId = DsfServiceID.createServiceId( IRegisters.class, fSession.getId() );
if (fServiceTracker == null) {
try {
fServiceTracker = new ServiceTracker(
DsfDebugUIPlugin.getBundleContext(),
DsfDebugUIPlugin.getBundleContext().createFilter(getServiceFilter()), null);
DsfDebugUIPlugin.getBundleContext().createFilter(serviceId), null);
fServiceTracker.open();
} catch (InvalidSyntaxException e) {
return null;
@ -75,21 +77,6 @@ public class SyncRegisterDataAccess {
return (IRegisters) fServiceTracker.getService();
}
private String getServiceFilter() {
StringBuffer filter = new StringBuffer();
filter.append("(&"); //$NON-NLS-1$
filter.append("(OBJECTCLASS="); //$NON-NLS-1$
filter.append(IRegisters.class.getName());
filter.append(')');
filter.append('(');
filter.append(IDsfService.PROP_SESSION_ID);
filter.append('=');
filter.append(fSession.getId());
filter.append(')');
filter.append(')');
return filter.toString();
}
@ThreadSafe
public synchronized void dispose() {
if ( fServiceTracker != null ) {

View file

@ -33,6 +33,7 @@ import org.eclipse.dd.dsf.debug.service.IExpressions.IExpressionDMContext;
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMData;
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
import org.eclipse.dd.dsf.service.DsfServiceID;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.dsf.service.IDsfService;
import org.eclipse.debug.core.DebugException;
@ -93,13 +94,7 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl
// amalgamated one because it is less error prone (and we are lazy).
// Create a tracker for the MemoryService
String memoryServiceFilter = "(&" + //$NON-NLS-1$
"(OBJECTCLASS=" //$NON-NLS-1$
+ IMemory.class.getName()
+ ")" + //$NON-NLS-1$
"(" + IDsfService.PROP_SESSION_ID //$NON-NLS-1$
+ "=" + dmc.getSessionId() + ")" + //$NON-NLS-1$//$NON-NLS-2$
")"; //$NON-NLS-1$
String memoryServiceFilter = DsfServiceID.createServiceId( IMemory.class, dmc.getSessionId() );
try {
fMemoryServiceTracker = new ServiceTracker(

View file

@ -23,7 +23,6 @@ import java.util.concurrent.TimeUnit;
import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor;
import org.eclipse.dd.dsf.concurrent.DsfExecutable;
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Display;
@ -46,7 +45,7 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
* @param display Display to create an executor for.
* @return The new (or re-used) executor.
*/
public static DsfExecutor getDisplayDsfExecutor(Display display) {
public static DisplayDsfExecutor getDisplayDsfExecutor(Display display) {
synchronized (fExecutors) {
DisplayDsfExecutor executor = fExecutors.get(display);
if (executor == null) {
@ -255,7 +254,6 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
@Override
public boolean isShutdown() {
// TODO Auto-generated method stub
return super.isShutdown();
}
}

View file

@ -99,7 +99,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
}
/**
* A base calss for the entry in the cache. Since the cache maintains
* A base class for the entry in the cache. Since the cache maintains
* a double-linked list through all the entries, the linked list references
* are maintained in this class.
*/
@ -394,7 +394,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
});
super.updateNode(node, updates);
} else if (update.getOffset() < 0 ) {
// The udpate requested all children. Fill in all children assuming that
// The update requested all children. Fill in all children assuming that
// the children array is complete.
// The following assert should never fail given the first if statement.
@ -548,9 +548,6 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
}
}
@Override
public void handleEvent(final Object event) {
IElementUpdateTester elementTester = getActiveUpdatePolicy().getTesterTester(event);
@ -611,7 +608,6 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
}
return proxy;
}
/**
* Called when a given all cache entries for the given root element have
@ -757,5 +753,4 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
}
return null;
}
}

View file

@ -45,7 +45,7 @@ public interface IDMContext extends IAdaptable
* originated. The session ID allows clients to choose the correct
* dispatch thread with which to access the service, and it allows the
* service to be uniquely identified among other sessions.
* @return Session ID of the service that originated the cotnext.
* @return Session ID of the service that originated the context.
*/
public String getSessionId();

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2008 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.dd.dsf.service;
/**
* Convenience class to create the somewhat complicated service ID which
* can then be used with the DsfServicesTracker or OSGI services tracker
* to find a desired service.
*/
public class DsfServiceID {
@SuppressWarnings("unchecked")
public static String createServiceId(Class serviceClass, String sessionId) {
String serviceId =
"(&" + //$NON-NLS-1$
"(OBJECTCLASS=" + //$NON-NLS-1$
serviceClass.getName() +
")" + //$NON-NLS-1$
"(" + //$NON-NLS-1$
IDsfService.PROP_SESSION_ID +
"=" + //$NON-NLS-1$
sessionId +
")" + //$NON-NLS-1$
")" ; //$NON-NLS-1$
return serviceId;
}
}