You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found a todo in the remote command line executor which indicates that currently all remote tasks are hard coded. A simple idea to make the console smarter would be the following:
public interface IRemoteTaskCreator
{
Task Create(PhysicalServer server, string[] args);
}
[InvokedWith("create_queue")]
public class CreateLocalMsmqQueueTaskCreator : IRemoteTaskCreator
{
public Task Create(PhysicalServer server, string[] args)
{
var queuename = args[1];
var queueAddress = new QueueAddress(queuename);
var transactional = false;
if (args.Length > 2)
{
bool.TryParse(args[2], out transactional);
}
var task = new CreateLocalMsmqQueueTask(server, queueAddress, transactional);
return task;
}
}
public class InvokedWithAttribute : Attribute
{
public string InvokeCommand { get; private set; }
public InvokedWithAttribute(string invokeCommand)
{
InvokeCommand = invokeCommand;
}
}
A simple reflection mechanism could cache all inheritors of IRemoteTaskCreator in a dictionary with <InvokeCommand , IRemoteTaskCreator>. The remote console then simple does:
var result = new DeploymentResult();
var creator = ClassWhichHasReflectionMagic.CreateRemoteTaskCreator(args[0]);
var task = creator.Create(_server, argsWithoutFirstEntry);
result = task.Execute();
return result;
Simple. Easy. Extendable.
The text was updated successfully, but these errors were encountered:
Found a todo in the remote command line executor which indicates that currently all remote tasks are hard coded. A simple idea to make the console smarter would be the following:
A simple reflection mechanism could cache all inheritors of IRemoteTaskCreator in a dictionary with <InvokeCommand , IRemoteTaskCreator>. The remote console then simple does:
var result = new DeploymentResult();
var creator = ClassWhichHasReflectionMagic.CreateRemoteTaskCreator(args[0]);
var task = creator.Create(_server, argsWithoutFirstEntry);
result = task.Execute();
return result;
Simple. Easy. Extendable.
The text was updated successfully, but these errors were encountered: