Java Code Examples for java.rmi.RemoteException

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project Arecibo, under directory /aggregator/src/main/java/com/ning/arecibo/aggregator/impl/.

Source file: AggregatorRegistry.java

  24 
vote

public synchronized void register(Aggregator agg,long leaseTime,TimeUnit leaseTimeUnit) throws RemoteException {
  try {
    String aggName=agg.getFullName();
    removeLeaseExpirationMonitor(aggName);
    scheduleLeaseExpirationMonitor(aggName,leaseTime,leaseTimeUnit);
    register(agg);
  }
 catch (  RuntimeException ruEx) {
    log.error(ruEx);
    throw new RemoteException("Got exception registering aggregator",ruEx);
  }
}
 

Example 2

From project Arecibo, under directory /aggregator/src/main/java/com/ning/arecibo/aggregator/impl/.

Source file: AggregatorRegistry.java

  21 
vote

public synchronized void register(Aggregator agg) throws RemoteException {
  try {
    registerLocal(agg);
  }
 catch (  RuntimeException ruEx) {
    log.error(ruEx);
    throw new RemoteException("Got exception registering aggregator",ruEx);
  }
}
 

Example 3

From project backend-update-center2, under directory /src/main/java/org/jvnet/hudson/update_center/.

Source file: ConfluencePluginList.java

  20 
vote

public RemotePage getPage(String url) throws RemoteException {
  Matcher tinylink=TINYLINK_PATTERN.matcher(url);
  if (tinylink.matches())   try {
    if (wikiSessionId == null)     wikiSessionId=initSession(WIKI_URL);
    url=checkRedirect(WIKI_URL + "pages/tinyurl.action?urlIdentifier=" + tinylink.group(1),wikiSessionId);
  }
 catch (  IOException e) {
    throw new RemoteException("Failed to lookup tinylink redirect",e);
  }
  for (  String p : WIKI_PREFIXES) {
    if (!url.startsWith(p))     continue;
    String pageName=url.substring(p.length()).replace('+',' ');
    RemotePage page=pageCache.get(pageName);
    if (page == null) {
      page=service.getPage("","JENKINS",pageName);
      pageCache.put(pageName,page);
    }
    return page;
  }
  throw new IllegalArgumentException("** Failed to resolve " + url);
}
 

Example 4

From project guice-jit-providers, under directory /extensions/throwingproviders/test/com/google/inject/throwingproviders/.

Source file: CheckedProviderTest.java

  20 
vote

private void tExceptionsScoped(Injector injector) throws Exception {
  RemoteProvider<Foo> remoteProvider=injector.getInstance(Key.get(remoteProviderOfFoo));
  mockRemoteProvider.throwOnNextGet(new RemoteException("A"));
  MockFoo.nextToThrow=new RemoteException("A");
  try {
    remoteProvider.get();
    fail();
  }
 catch (  RemoteException expected) {
    assertEquals("A",expected.getMessage());
  }
  mockRemoteProvider.throwOnNextGet(new RemoteException("B"));
  MockFoo.nextToThrow=new RemoteException("B");
  try {
    remoteProvider.get();
    fail();
  }
 catch (  RemoteException expected) {
    assertEquals("A",expected.getMessage());
  }
}
 

Example 5

From project akubra, under directory /akubra-rmi/src/main/java/org/akubraproject/rmi/.

Source file: AkubraRMIServer.java

  19 
vote

/** 
 * Creates an AkubraRMIServer that exports the given Blob Store for remote access.
 * @param store the store to export.
 * @param name the name to register with RMI registry
 * @param registry the RMI registry
 * @param registryPort the RMI registry port
 * @param exporter the exporter for the BlobStore
 * @throws AccessException when the caller does not have permission to export
 * @throws RemoteException on any other error in export
 */
public AkubraRMIServer(BlobStore store,String name,Registry registry,int registryPort,Exporter exporter) throws AccessException, RemoteException {
  log.info("Starting server '" + name + "'  ...");
  this.store=new ServerStore(store,exporter);
  this.registry=registry;
  this.name=name;
  registry.rebind(name,this.store);
  log.info("Server '" + name + "' is bound to registry on port "+ registryPort);
}
 

Example 6

From project akubra, under directory /akubra-rmi/src/main/java/org/akubraproject/rmi/.

Source file: AkubraRMIServer.java

  19 
vote

/** 
 * Ensures that an RMI registry is running at the given port on the given server.
 * @param host the RMI registry host
 * @param port the RMI registry port
 * @param csf the client-side socket factory for making calls to the remote object
 * @param ssf the server-side socket factory for receiving remote calls
 * @return the client side stub to RMI Rgistry
 * @throws RemoteException on an error in starting up the registry
 */
public static Registry ensureRegistry(String host,int port,RMIClientSocketFactory csf,RMIServerSocketFactory ssf) throws RemoteException {
  if (port <= 0)   port=Registry.REGISTRY_PORT;
  Registry reg=LocateRegistry.getRegistry(host,port,csf);
  if (exists(reg))   log.info("Located an RMI registry at '" + host + ":"+ port+ "'");
 else {
    log.info("Starting RMI registry on 'localhost:" + port + "'");
    reg=LocateRegistry.createRegistry(port,csf,ssf);
  }
  return reg;
}
 

Example 7

From project ANNIS, under directory /annis-gui/src/main/java/annis/gui/servlets/.

Source file: BinaryServlet.java

  19 
vote

private void responseStatus206(WebResource binaryRes,ServletOutputStream out,HttpServletResponse response,String range) throws RemoteException, IOException {
  AnnisBinaryMetaData bm=binaryRes.path("meta").get(AnnisBinary.class);
  String[] rangeTupel=range.split("-");
  int offset=Integer.parseInt(rangeTupel[0].split("=")[1]);
  int slice;
  if (rangeTupel.length > 1) {
    slice=Integer.parseInt(rangeTupel[1]);
  }
 else {
    slice=bm.getLength();
  }
  int lengthToFetch=slice - offset;
  response.setHeader("Content-Range","bytes " + offset + "-"+ (bm.getLength() - 1)+ "/"+ bm.getLength());
  response.setContentType(bm.getMimeType());
  response.setStatus(206);
  response.setContentLength(lengthToFetch);
  writeStepByStep(offset,lengthToFetch,binaryRes,out);
}
 

Example 8

From project ANNIS, under directory /annis-gui/src/main/java/annis/gui/servlets/.

Source file: BinaryServlet.java

  19 
vote

private void responseStatus200(WebResource binaryRes,ServletOutputStream out,HttpServletResponse response) throws RemoteException, IOException {
  AnnisBinaryMetaData binaryMeta=binaryRes.path("meta").get(AnnisBinary.class);
  response.setStatus(200);
  response.setHeader("Accept-Ranges","bytes");
  response.setContentType(binaryMeta.getMimeType());
  response.setHeader("Content-Range","bytes 0-" + (binaryMeta.getLength() - 1) + "/"+ binaryMeta.getLength());
  response.setContentLength(binaryMeta.getLength());
  getCompleteFile(binaryRes,out);
}
 

Example 9

From project backend-update-center2, under directory /src/main/java/org/jvnet/hudson/update_center/.

Source file: ConfluencePluginList.java

  19 
vote

/** 
 * Finds the closest match, if any. Otherwise null.
 */
public RemotePage findNearest(String pluginArtifactId) throws RemoteException {
  pluginArtifactId=pluginArtifactId.toLowerCase();
  String nearest=EditDistance.findNearest(pluginArtifactId,normalizedTitles);
  if (EditDistance.editDistance(nearest,pluginArtifactId) <= 1) {
    System.out.println("** No wiki page specified.. picking one with similar name." + "\nUsing '" + nearest + "' for "+ pluginArtifactId);
    return service.getPage("","JENKINS",children.get(nearest).getTitle());
  }
 else   return null;
}
 

Example 10

From project brix-cms, under directory /brix-workspace/src/main/java/org/brixcms/workspace/rmi/.

Source file: ClientWorkspace.java

  19 
vote

public RemoteWorkspace getDelegate(){
  if (delegate == null) {
    try {
      delegate=remoteWorkspaceManager.getWorkspace(id);
    }
 catch (    RemoteException e) {
      throw new CommunicationException(e);
    }
  }
  return delegate;
}
 

Example 11

From project brix-cms, under directory /brix-workspace/src/main/java/org/brixcms/workspace/rmi/.

Source file: ClientWorkspace.java

  19 
vote

public String getId(){
  if (id == null) {
    try {
      return id=getDelegate().getId();
    }
 catch (    RemoteException e) {
      throw new CommunicationException(e);
    }
  }
  return id;
}
 

Example 12

From project byteman, under directory /contrib/dtest/src/org/jboss/byteman/contrib/dtest/.

Source file: InstrumentedClass.java

  19 
vote

/** 
 * Receiving side of the remote communication between the test code and the BytemanTestHelper.
 * @param methodName the method name that was traced.
 * @param args the arguments to the method invocation, in String form.
 * @throws RemoteException in case of communication failure.
 * @see BytemanTestHelper#remoteTrace(String,String,Object[])
 */
@Override public void trace(String methodName,Object[] args) throws RemoteException {
  Integer objectId=(Integer)args[0];
  if (objectId == null) {
    objectId=STATIC_INSTANCE_ID;
  }
  InstrumentedInstance instrumentedInstance=instrumentedInstances.get(objectId);
  if (instrumentedInstance == null) {
    instrumentedInstance=new InstrumentedInstance(className,objectId);
    instrumentedInstances.put(objectId,instrumentedInstance);
  }
  Object[] innerArgs=new Object[args.length - 1];
  System.arraycopy(args,1,innerArgs,0,innerArgs.length);
  instrumentedInstance.addMethodTrace(methodName,innerArgs);
}
 

Example 13

From project CalendarPortlet, under directory /contrib/blackboard-vista/.

Source file: BlackboardVistaICalAdapter.java

  19 
vote

/** 
 * Login to Blackboard and return the session.
 * @param calendar calendar configuration for which to retrieve events
 * @param request user's portlet request
 * @return Session for the Blackboard user
 * @throws CalendarException
 */
protected SessionVO doLogin(CalendarConfiguration calendarConfig,String username,String password) throws CalendarException {
  ContextSDK ctxt=null;
  SessionVO session=null;
  String url=(String)calendarConfig.getCalendarDefinition().getParameters().get("url");
  String glcid=(String)calendarConfig.getCalendarDefinition().getParameters().get("glcid");
  try {
    ctxt=new ContextSDK(new URL(url + "Context"));
    session=ctxt.login(username,password,glcid);
    return session;
  }
 catch (  MalformedURLException mue) {
    throw new CalendarException("Problem with Context URL");
  }
catch (  RemoteException re) {
    throw new CalendarException("Problem logging in to Blackboard");
  }
 finally {
    if (ctxt != null) {
      log.debug("Logging out");
      try {
        ctxt.logout(session);
      }
 catch (      Exception exception) {
      }
    }
  }
}
 

Example 14

From project cloudify, under directory /CLI/src/main/java/org/cloudifysource/shell/installer/.

Source file: LocalhostGridAgentBootstrapper.java

  19 
vote

/** 
 * Shuts down the given agent, and waits until shutdown is complete or until the timeout is reached.
 * @param agent The agent to shutdown
 * @param timeout number of {@link TimeUnit}s to wait
 * @param timeunit the {@link TimeUnit} to use, to calculate the timeout
 * @throws InterruptedException Reporting the thread was interrupted while waiting
 * @throws TimeoutException Reporting the timeout was reached
 * @throws CLIException Reporting a failure to shutdown the agent
 */
private void shutdownAgentAndWait(final GridServiceAgent agent,final long timeout,final TimeUnit timeunit) throws InterruptedException, TimeoutException, CLIException {
  final GSA gsa=((InternalGridServiceAgent)agent).getGSA();
  try {
    gsa.shutdown();
  }
 catch (  final RemoteException e) {
    if (!NetworkExceptionHelper.isConnectOrCloseException(e)) {
      logger.log(Level.FINER,"Failed to shutdown GSA",e);
      throw new AdminException("Failed to shutdown GSA",e);
    }
  }
  createConditionLatch(timeout,timeunit).waitFor(new ConditionLatch.Predicate(){
    private boolean messagePublished=false;
    /** 
 * Pings the agent to verify it's not available, indicating it was shut down.
 */
    @Override public boolean isDone() throws CLIException, InterruptedException {
      if (!messagePublished) {
        final String shuttingDownAgentMessage=ShellUtils.getMessageBundle().getString("shutting_down_cloudify_agent_teardown_localcloud");
        publishEvent(shuttingDownAgentMessage);
        final String shuttingDownManagmentMessage=ShellUtils.getMessageBundle().getString("shutting_down_cloudify_managment");
        publishEvent(shuttingDownManagmentMessage);
        messagePublished=true;
      }
      logger.fine("Waiting for agent to shutdown");
      try {
        gsa.ping();
      }
 catch (      final RemoteException e) {
        return true;
      }
      publishEvent(null);
      return false;
    }
  }
);
}
 

Example 15

From project cloudify, under directory /esc/src/main/java/org/cloudifysource/esc/driver/provisioning/byon/.

Source file: ByonProvisioningDriver.java

  19 
vote

private void stopAgentAndWait(final int expectedGsmCount,final String ipAddress) throws TimeoutException, InterruptedException {
  if (admin == null) {
    admin=Utils.getAdminObject(ipAddress,expectedGsmCount);
  }
  final Map<String,GridServiceAgent> agentsMap=admin.getGridServiceAgents().getHostAddress();
  GSA agent=null;
  for (  Entry<String,GridServiceAgent> agentEntry : agentsMap.entrySet()) {
    if (agentEntry.getKey().equalsIgnoreCase(ipAddress)) {
      agent=((InternalGridServiceAgent)agentEntry.getValue()).getGSA();
    }
  }
  if (agent != null) {
    logger.info("ByonProvisioningDriver: shutting down agent on server: " + ipAddress);
    try {
      admin.close();
      agent.shutdown();
    }
 catch (    final RemoteException e) {
      if (!NetworkExceptionHelper.isConnectOrCloseException(e)) {
        logger.log(Level.FINER,"Failed to shutdown GSA",e);
        throw new AdminException("Failed to shutdown GSA",e);
      }
    }
    final long end=System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(AGENT_SHUTDOWN_TIMEOUT_IN_MINUTES);
    boolean agentUp=isAgentUp(agent);
    while (agentUp && System.currentTimeMillis() < end) {
      logger.fine("next check in " + TimeUnit.MILLISECONDS.toSeconds(THREAD_WAITING_IDLE_TIME_IN_SECS) + " seconds");
      Thread.sleep(TimeUnit.SECONDS.toMillis(THREAD_WAITING_IDLE_TIME_IN_SECS));
      agentUp=isAgentUp(agent);
    }
    if (!agentUp && System.currentTimeMillis() >= end) {
      throw new TimeoutException("Agent shutdown timed out (agent IP: " + ipAddress + ")");
    }
  }
}
 

Example 16

From project clustermeister, under directory /api/src/main/java/com/github/nethad/clustermeister/api/impl/.

Source file: ClustermeisterImpl.java

  19 
vote

private void setupRmi() throws RuntimeException {
  final String policyUrl=ClustermeisterImpl.class.getResource("/cm.policy").toString();
  logger.info("Policy file URL: {}",policyUrl);
  System.setProperty("java.security.policy",policyUrl);
  if (System.getSecurityManager() == null) {
    System.setSecurityManager(new SecurityManager());
  }
  try {
    Registry registry=LocateRegistry.getRegistry(61111);
    rmiServerForApi=(IRmiServerForApi)registry.lookup(IRmiServerForApi.NAME);
  }
 catch (  NotBoundException ex) {
    throw new RuntimeException(ex);
  }
catch (  AccessException ex) {
    throw new RuntimeException(ex);
  }
catch (  RemoteException ex) {
    throw new RuntimeException(ex);
  }
}
 

Example 17

From project clustermeister, under directory /api/src/main/java/com/github/nethad/clustermeister/api/impl/.

Source file: ClustermeisterImpl.java

  19 
vote

protected void gatherNodeInformation(){
  try {
    nodeInformationCollection=rmiServerForApi.getAllNodes();
    logger.info("Provisioning returned {} nodes.",nodeInformationCollection.size());
    nodes=new LinkedList<ExecutorNode>();
    for (    NodeInformation nodeInfo : nodeInformationCollection) {
      ExecutorNodeImpl executorNode=new ExecutorNodeImpl(jppfClient,threadsExecutorService);
      executorNode.setId(nodeInfo.getID());
      int availableProcessors=Integer.valueOf(nodeInfo.getJPPFSystemInformation().getRuntime().getProperty(JPPFProperties.AVAILABLE_PROCESSORS));
      int numberOfProcessingThreads=Integer.valueOf(nodeInfo.getJPPFSystemInformation().getJppf().getProperty(JPPFProperties.PROCESSING_THREADS));
      final String jppfInfo=nodeInfo.getJPPFSystemInformation().getJppf().asString();
      NodeCapabilities nodeCapabilities=new NodeCapabilitiesImpl(availableProcessors,numberOfProcessingThreads,jppfInfo);
      executorNode.setNodeCapabilities(nodeCapabilities);
      nodes.add(executorNode);
    }
  }
 catch (  RemoteException ex) {
    logger.error("Could not get list of nodes via RMI.",ex);
  }
}
 

Example 18

From project codjo-segmentation, under directory /codjo-segmentation-gui/src/test/java/net/codjo/segmentation/gui/plugin/.

Source file: SegmentationGuiPluginTest.java

  19 
vote

private void initServerWrapperMock() throws RemoteException {
  ServerWrapper serverWrapper=Mockito.mock(ServerWrapper.class);
  ServerWrapperFactory.setPrototype(serverWrapper);
  Mockito.when(serverWrapper.copy()).thenReturn(serverWrapper);
  Mockito.when(serverWrapper.sendWaitResponse(Mockito.anyString(),Mockito.anyLong())).thenReturn("<?xml version=\"1.0\"?><results><result request_id='1'><row><field name=\"result\"><![CDATA[<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<structure></structure>]]></field></row></result></results>");
}
 

Example 19

From project com.idega.content, under directory /src/java/com/idega/content/bean/.

Source file: ContentItemBean.java

  19 
vote

protected boolean loadFromWebDav(String path) throws IOException, RemoteException, HttpException {
  IWUserContext iwuc=IWContext.getInstance();
  boolean returner=true;
  try {
    IWSlideSession session=getIWSlideSession(iwuc);
    WebdavExtendedResource webdavResource=session.getResource(path,Boolean.FALSE);
    webdavResource.setProperties();
    setResourcePath(webdavResource.getPath());
    setName(webdavResource.getDisplayName());
    String createDate=webdavResource.getCreationDateString();
    if (createDate != null) {
      setCreationDate(new IWTimestamp(createDate).getTimestamp());
    }
    long lLastmodified=webdavResource.getGetLastModified();
    IWTimestamp lastModified=new IWTimestamp(lLastmodified);
    setLastModifiedDate(lastModified.getTimestamp());
    setWebDavResourceCategories(webdavResource.propfindMethod(IWSlideConstants.PROPERTYNAME_CATEGORY));
    returner=load(webdavResource);
    setExists(true);
  }
 catch (  HttpException e) {
    if (e.getReasonCode() == WebdavStatus.SC_NOT_FOUND) {
      setRendered(false);
      return false;
    }
 else {
      throw e;
    }
  }
  return returner;
}
 

Example 20

From project com.idega.content, under directory /src/java/com/idega/content/bean/.

Source file: ContentItemFeedBean.java

  19 
vote

public String getFeedEntryAsXML(String feedTitle,String serverName,String feedDescription,EntryData entryData){
  if (rss == null) {
    return null;
  }
  if (entryData.getUpdated() == null) {
    entryData.setUpdated(new Timestamp(System.currentTimeMillis()));
  }
  SyndFeed feed=createFeedWithEntry(feedTitle,serverName,feedDescription,entryData);
  if (feed == null) {
    return null;
  }
  if (FEED_TYPE_ATOM_1.equals(feed.getFeedType())) {
    try {
      return rss.convertFeedToAtomXMLString(feed);
    }
 catch (    RemoteException e) {
      e.printStackTrace();
      return null;
    }
  }
  if (FEED_TYPE_RSS_2.equals(feed.getFeedType())) {
    try {
      return rss.convertFeedToRSS2XMLString(feed);
    }
 catch (    RemoteException e) {
      e.printStackTrace();
      return null;
    }
  }
  return null;
}
 

Example 21

From project des, under directory /daemon/lib/apache-log4j-1.2.16/examples/.

Source file: NumberCruncherClient.java

  19 
vote

static void loop(NumberCruncher nc){
  BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
  int i=0;
  while (true) {
    System.out.print("Enter a number to factor, '-1' to quit: ");
    try {
      i=Integer.parseInt(in.readLine());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (i == -1) {
      System.out.print("Exiting loop.");
      return;
    }
 else {
      try {
        System.out.println("Will attempt to factor " + i);
        int[] factors=nc.factor(i);
        System.out.print("The factors of " + i + " are");
        for (int k=0; k < factors.length; k++) {
          System.out.print(" " + factors[k]);
        }
        System.out.println(".");
      }
 catch (      RemoteException e) {
        System.err.println("Could not factor " + i);
        e.printStackTrace();
      }
    }
  }
}
 

Example 22

From project des, under directory /daemon/lib/apache-log4j-1.2.16/examples/.

Source file: NumberCruncherServer.java

  19 
vote

public int[] factor(int number) throws RemoteException {
  try {
    NDC.push(getClientHost());
  }
 catch (  java.rmi.server.ServerNotActiveException e) {
    NDC.push("localhost");
  }
  NDC.push(String.valueOf(number));
  logger.info("Beginning to factor.");
  if (number <= 0) {
    throw new IllegalArgumentException(number + " is not a positive integer.");
  }
 else   if (number == 1)   return new int[]{1};
  Vector factors=new Vector();
  int n=number;
  for (int i=2; (i <= n) && (i * i <= number); i++) {
    logger.debug("Trying to see if " + i + " is a factor.");
    if ((n % i) == 0) {
      logger.info("Found factor " + i);
      factors.addElement(new Integer(i));
      do {
        n/=i;
      }
 while ((n % i) == 0);
    }
    delay(100);
  }
  if (n != 1) {
    logger.info("Found factor " + n);
    factors.addElement(new Integer(n));
  }
  int len=factors.size();
  int[] result=new int[len];
  for (int i=0; i < len; i++) {
    result[i]=((Integer)factors.elementAt(i)).intValue();
  }
  NDC.remove();
  return result;
}
 

Example 23

From project enterprise, under directory /ha/src/main/java/org/neo4j/kernel/ha/shell/.

Source file: Pullupdates.java

  19 
vote

@Override protected Continuation exec(AppCommandParser parser,Session session,Output out) throws ShellException, RemoteException {
  if (!(getServer().getDb() instanceof HighlyAvailableGraphDatabase)) {
    throw new ShellException("Your database isn't started in HA mode");
  }
  ((HighlyAvailableGraphDatabase)getServer().getDb()).pullUpdates();
  return Continuation.INPUT_COMPLETE;
}
 

Example 24

From project enterprise, under directory /ha/src/test/java/slavetest/.

Source file: CommonJobs.java

  19 
vote

public final T execute(GraphDatabaseAPI db) throws RemoteException {
  Transaction tx=db.beginTx();
  try {
    return executeInTransaction(db,tx);
  }
 catch (  RuntimeException e) {
    e.printStackTrace(System.out);
    throw e;
  }
 finally {
    beforeFinish();
    tx.finish();
  }
}
 

Example 25

From project gs-core, under directory /src/org/graphstream/stream/rmi/.

Source file: RMISink.java

  19 
vote

public void register(String url) throws RemoteException {
  try {
    RMIAdapterIn in=(RMIAdapterIn)Naming.lookup(url);
    if (in != null)     inputs.put(url,in);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 26

From project guice-jit-providers, under directory /extensions/throwingproviders/test/com/google/inject/throwingproviders/.

Source file: CheckedProviderMethodsModuleTest.java

  19 
vote

public void testWithScope() throws BindException, RemoteException {
  TestModule testModule=new TestModule();
  Injector injector=Guice.createInjector(testModule);
  RpcProvider<Integer> provider=injector.getInstance(Key.get(rpcProviderOfInteger));
  assertEquals((Integer)100,provider.get());
  testModule.setNextIntToReturn(120);
  assertEquals((Integer)100,provider.get());
  testScope.beginNewScope();
  assertEquals((Integer)120,provider.get());
}